{"id":18646,"date":"2012-06-18T07:42:19","date_gmt":"2012-06-18T07:42:19","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/default-theme-pages\/"},"modified":"2012-08-30T12:55:22","modified_gmt":"2012-08-30T12:55:22","slug":"default-theme-pages","status":"publish","type":"plugin","link":"https:\/\/bal.wordpress.org\/plugins\/default-theme-pages\/","author":7875580,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"0.4","stable_tag":"trunk","tested":"3.4.2","requires":"3.0","requires_php":"","requires_plugins":"","header_name":"Default theme pages","header_author":"Carlos Sanz Garc\u00eda","header_description":"","assets_banners_color":"fbfbfb","last_updated":"2012-08-30 12:55:22","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/github.com\/not-only-code\/default-theme-pages","header_author_uri":"http:\/\/codingsomething.wordpress.com\/","rating":0,"author_block_rating":0,"active_installs":10,"downloads":2522,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":[],"assets_banners":{"banner-772x250.png":{"filename":"banner-772x250.png","revision":"559748","resolution":"772x250","location":"assets"}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.2"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"1539392","resolution":"1","location":"plugin"}},"screenshots":{"1":"Admin pages list"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[1220,243,15475,1141],"plugin_category":[],"plugin_contributors":[],"plugin_business_model":[],"class_list":["post-18646","plugin","type-plugin","status-publish","hentry","plugin_tags-block","plugin_tags-pages","plugin_tags-templating","plugin_tags-theme","plugin_committers-carlos_a_sanz"],"banners":{"banner":"https:\/\/ps.w.org\/default-theme-pages\/assets\/banner-772x250.png?rev=559748","banner_2x":false,"banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/default-theme-pages_fbfbfb.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/default-theme-pages\/trunk\/screenshot-1.png?rev=1539392","caption":"Admin pages list"}],"raw_content":"<!--section=description-->\n<h4>This plugin is intended to be useful for template developers<\/h4>\n\n<h4>New in version 0.4<\/h4>\n\n<ul>\n<li>added 'object' (page object) in every $default_theme_pages item for fast access.<\/li>\n<li>added all default pages to wp toolbar, inside 'site name', to increase user experience.<\/li>\n<\/ul>\n\n<h4>How to use<\/h4>\n\n<p>Add this code in your <em>functions.php<\/em>.<\/p>\n\n<pre><code>global $default_theme_pages;\n$default_theme_pages = array(\n    array(\n        'name' =&gt; 'home',               \/\/ initial slug page \/ id for templating - access functions\n        'title' =&gt; 'Homepage',          \/\/ page title\n        'option' =&gt; 'page_on_front',    \/\/ option page id ( stores the page id in an option, use only in theese cases)\n        'description' =&gt; 'homepage'     \/\/ description\n    ),\n    array(\n        'name' =&gt; 'blog',\n        'title' =&gt; 'Blog',\n        'option' =&gt; 'page_for_posts',\n        'description' =&gt; 'blog'\n    ),\n    array(\n        'name' =&gt; 'contact',\n        'title' =&gt; 'Contact me!',\n        'description' =&gt; 'Contact form page'\n    )\n );\n<\/code><\/pre>\n\n<h4>Tips<\/h4>\n\n<ul>\n<li>After the pages are created automatically, you can change their title and slug without problem.<\/li>\n<li>If you add an <code>option<\/code> names: <code>page_on_front<\/code> and <code>page_for_posts<\/code>, you will block the <em>home-page<\/em> and the <em>blog-page<\/em> on your site.<\/li>\n<\/ul>\n\n<h4>Templating<\/h4>\n\n<p>You can template using <strong>ID<\/strong> or <strong>name<\/strong> (setted up in $default_theme_pages global variable ), something like:<\/p>\n\n<p><strong>page-131.php<\/strong> or <strong>page-contact.php<\/strong> (If you change the page slug, this will still work because 'contact' was defined as <em>pagename<\/em> if $default_theme_pages global variable).<\/p>\n\n<p>For detect if you're in that page:<\/p>\n\n<pre><code>dtp_is_page('contact')\n<\/code><\/pre>\n\n<p>Getting a default page id:<\/p>\n\n<pre><code>$page_id = dtp_get_page_id('contact');\n<\/code><\/pre>\n\n<p>This method is more quick than <em>get_page_by_path<\/em> because page ID is stored on global variable.<\/p>\n\n<!--section=changelog-->\n<h4>0.4<\/h4>\n\n<ul>\n<li>added 'object' (page object) in every $default_theme_pages item for fast access.<\/li>\n<li>added all default pages to wp toolbar, inside 'site name', to increase user experience.<\/li>\n<\/ul>\n\n<h4>0.3<\/h4>\n\n<ul>\n<li>changed stored system to gain performance<\/li>\n<li>added 'id' in every $default_theme_pages item for fast use<\/li>\n<li>added some accessible functions: <code>dtp_is_page<\/code>, <code>dtp_get_page_id<\/code><\/li>\n<li>added default pages in template system, now you can template a default page as: <code>page-name.php<\/code><\/li>\n<\/ul>\n\n<h4>0.2<\/h4>\n\n<ul>\n<li>blocked status modifications<\/li>\n<li>blocked move to trash<\/li>\n<\/ul>\n\n<h4>0.1<\/h4>\n\n<ul>\n<li>Initial release<\/li>\n<\/ul>","raw_excerpt":"Adds unremovable default pages for templating themes","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/18646","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=18646"}],"author":[{"embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/carlos_a_sanz"}],"wp:attachment":[{"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=18646"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=18646"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=18646"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=18646"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=18646"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/bal.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=18646"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}