{"id":49587,"date":"2016-07-08T21:05:59","date_gmt":"2016-07-08T21:05:59","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/acf-cpt-options-pages\/"},"modified":"2023-04-08T14:30:19","modified_gmt":"2023-04-08T14:30:19","slug":"acf-cpt-options-pages","status":"publish","type":"plugin","link":"https:\/\/sa.wordpress.org\/plugins\/acf-cpt-options-pages\/","author":11242162,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"2.0.9","stable_tag":"trunk","tested":"6.2.9","requires":"3.0","requires_php":"","requires_plugins":"","header_name":"Advanced Custom Fields : CPT Options Pages","header_author":"Tusko Trush","header_description":"","assets_banners_color":"dfdfe0","last_updated":"2023-04-08 14:30:19","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/donatua.com\/@tusko","header_plugin_uri":"https:\/\/wordpress.org\/plugins\/acf-cpt-options-pages\/","header_author_uri":"https:\/\/frontend.im\/","rating":5,"author_block_rating":0,"active_installs":2000,"downloads":63708,"num_ratings":7,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":{"1.0.2":"<ul>\n<li>Update documentation.<\/li>\n<li>Change labels and slugs.<\/li>\n<\/ul>"},"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"7"},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":2105355,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.png":{"filename":"icon-256x256.png","revision":2105355,"resolution":"256x256","location":"assets","locale":""}},"assets_banners":{"banner-772x250.png":{"filename":"banner-772x250.png","revision":1490128,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":[],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":1490128,"resolution":"1","location":"assets","locale":""}},"screenshots":{"1":"assets\/screenshot-1.png"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[76764,2217,1445,1794],"plugin_category":[],"plugin_contributors":[90465],"plugin_business_model":[],"class_list":["post-49587","plugin","type-plugin","status-publish","hentry","plugin_tags-acf-options","plugin_tags-advanced-custom-fields","plugin_tags-archive","plugin_tags-custom-post-type","plugin_contributors-tusko-trush","plugin_committers-tusko-trush"],"banners":{"banner":"https:\/\/ps.w.org\/acf-cpt-options-pages\/assets\/banner-772x250.png?rev=1490128","banner_2x":false,"banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/acf-cpt-options-pages\/assets\/icon-128x128.png?rev=2105355","icon_2x":"https:\/\/ps.w.org\/acf-cpt-options-pages\/assets\/icon-256x256.png?rev=2105355","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/acf-cpt-options-pages\/assets\/screenshot-1.png?rev=1490128","caption":"assets\/screenshot-1.png"}],"raw_content":"<!--section=description-->\n<p>Small addon for ACF Options. Adds ACF location for each custom post type.<\/p>\n\n<p><strong>New feature<\/strong> in the major version 2!<br \/>\nImportant!<br \/>\n<strong>After update to v2+ you must reconnect Field Groups to Options Pages<\/strong><\/p>\n\n<p>Now you can activate\/deactivate CPTs and create custom options pages for each CPT.\nBy default, options pages are activated for all custom post types.<\/p>\n\n<h4>Usage<\/h4>\n\n<p>The default functions of <a href=\"http:\/\/www.advancedcustomfields.com\/\" title=\"Advanced Custom Fields\">ACF plugin<\/a> (<code>get_field, the_field, etc.<\/code>) can be used to load values from a CPT Options Pages, but second parameter is required to target the CPT options.<\/p>\n\n<p>This is similar to passing through a <code>$post_id<\/code> parameter to target a specific post object.<\/p>\n\n<p>The <code>$post_id<\/code> parameter needed is a string containing the <code>cpt_<\/code> and CPT name in the following format; <code>\"cpt_{CPT_NAME}\"<\/code> and for subpages you can copy generated ID while creating subpages.<\/p>\n\n<h4>Examples<\/h4>\n\n<blockquote>\n  <p>In examples Custom Post Type name is <code>projects<\/code>.<\/p>\n<\/blockquote>\n\n<p>So, let's go!<\/p>\n\n<p><strong>Display a field<\/strong><\/p>\n\n<pre><code>&lt;p&gt;&lt;?php the_field('field_name', 'cpt_projects'); ?&gt;&lt;\/p&gt;\n<\/code><\/pre>\n\n<p>and the subpage's field<\/p>\n\n<pre><code>&lt;p&gt;&lt;?php the_field('field_name', 'cpt_projects_testpage'); ?&gt;&lt;\/p&gt;\n<\/code><\/pre>\n\n<p><strong>Retrieve a field<\/strong><\/p>\n\n<pre><code>&lt;?php\n    $field = get_field('field_name', 'cpt_projects');\n    \/\/ do something with $field\n?&gt;\n<\/code><\/pre>\n\n<p><strong>Display a sub field<\/strong><\/p>\n\n<pre><code>    &lt;?php if( have_rows('repeater_name', 'cpt_projects') ): ?&gt;\n        &lt;ul&gt;\n            &lt;?php while( have_rows('repeater_name', 'cpt_projects') ): the_row(); ?&gt;\n                &lt;li&gt;&lt;?php the_sub_field('the_title'); ?&gt;&lt;\/li&gt;\n            &lt;?php endwhile; ?&gt;\n        &lt;\/ul&gt;\n    &lt;?php endif; ?&gt;\n<\/code><\/pre>\n\n<p><strong>Display with shortcode<\/strong><\/p>\n\n<pre><code>[acf field=\"field_name\" post_id=\"cpt_projects\"]\n<\/code><\/pre>\n\n<blockquote>\n  <p>Please read documentation about <a href=\"http:\/\/www.advancedcustomfields.com\/resources\/shortcode\/\" title=\"ACF Shortcode\">shortcodes with ACF<\/a><\/p>\n<\/blockquote>\n\n<h3>Customization<\/h3>\n\n<pre><code>    function cpt_projects_customize($cptmenu) {\n        $cptmenu['page_title'] = 'Dev Custom title';\n        $cptmenu['menu_title'] = 'Dev Custom title';\n        return $cptmenu;\n    }\n\n    add_filter('cpt_projects_acf_page_args', 'cpt_projects_customize');\n<\/code><\/pre>\n\n<p>Don't forget to replace <code>cpt_projects_<\/code> to your custom post type name :)\nIt works only for first level options pages, not for subpages.<\/p>\n\n<h4>Donate<\/h4>\n\n<p><a href=\"https:\/\/donatua.com\/@tusko\">Support plugin<\/a><\/p>\n\n<h4>License<\/h4>\n\n<p>Copyright (c) 2023, <a href=\"https:\/\/frontend.im\/?github\" title=\"Front-End Developer\">Tusko Trush<\/a><\/p>\n\n<h4>Requirements<\/h4>\n\n<p>You must buy ACF PRO or ACF Options Page Addon.<\/p>\n\n<h4>Translation<\/h4>\n\n<p><strong>qTranslate-XT<\/strong><\/p>\n\n<p>This plugin is compatible and has included <a href=\"https:\/\/uk.wordpress.org\/plugins\/acf-qtranslate\/\" title=\"ACF qTranslate\">ACF qTranslate<\/a>.\nJust enjoy!<\/p>\n\n<p><strong>qTranslate-X<\/strong><\/p>\n\n<p>If you are using Qtranslate-X, you must install <a href=\"https:\/\/uk.wordpress.org\/plugins\/acf-qtranslate\/\" title=\"ACF qTranslate\">ACF qTranslate<\/a>.<\/p>\n\n<p><strong>WPML\/Polylang<\/strong><\/p>\n\n<p>If you are using WPML or Polylang, you must add constant <code>ICL_LANGUAGE_CODE<\/code> to <code>post_id<\/code>,\nfor example: <code>get_field('archive_title', 'cpt_projects_' . ICL_LANGUAGE_CODE)<\/code>.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload 'acf-cpt-options-pages' to the <code>\/wp-content\/plugins\/<\/code> directory.<\/li>\n<li>Activate the plugin through the<code>Plugins<\/code> menu in WordPress.<\/li>\n<li>Go to <code>Custom fields<\/code> submenu <code>CPT Options page<\/code> and activate CPTs what you need or create subpages for that.<\/li>\n<li>Create your Custom Field Group, set location rule <code>Options Page<\/code> and choose your CPT options page or subpage.<\/li>\n<li>Read the documentation to display your data.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<p>If you have any questions on this please post an issue\/question at <a href=\"https:\/\/github.com\/Tusko\/ACF-CPT-Options-Pages\/issues\">Github Issues<\/a><\/p>\n\n<!--section=changelog-->\n<h4>2.0.9<\/h4>\n\n<ul>\n<li>Tested up with WP 6.2 and ACF Pro 6.1.3<\/li>\n<\/ul>\n\n<h4>2.0.8<\/h4>\n\n<ul>\n<li>Tested up with WP 5.8.1 and ACF Pro 5.10.2<\/li>\n<li>Fix lang switcher and Wysiwyg Editor capability on ACF CPT Options pages<\/li>\n<li>Modified page slug  '-options' -&gt; 'acfcpt-options' to make qTranslate config regex<\/li>\n<\/ul>\n\n<h4>2.0.7<\/h4>\n\n<ul>\n<li>Tested up 5.7.2<\/li>\n<li>@Ekeler PR: Update class.acf-cpt-options-pages.php<\/li>\n<\/ul>\n\n<h4>2.0.6<\/h4>\n\n<ul>\n<li>Tested up 5.7.1<\/li>\n<li>Added apply_filters cpt_options_post_types_params<\/li>\n<\/ul>\n\n<h4>2.0.5<\/h4>\n\n<ul>\n<li>Tested up 5.3.2<\/li>\n<li>Fix donate links<\/li>\n<\/ul>\n\n<h4>2.0.4<\/h4>\n\n<ul>\n<li>Tested up 5.2.1<\/li>\n<li>Assets updated<\/li>\n<\/ul>\n\n<h4>2.0.3<\/h4>\n\n<ul>\n<li>Fixed underscores in options pages title<\/li>\n<\/ul>\n\n<h4>2.0.2<\/h4>\n\n<ul>\n<li>Fixed WPML slugs<\/li>\n<\/ul>\n\n<h4>2.0.0<\/h4>\n\n<ul>\n<li>Added Russian, Ukrainian translations.<\/li>\n<li>Added setting page to ACF CPT Options Pages<\/li>\n<li>Added UI to manage options pages per CPT<\/li>\n<li>Ability to add child pages to CPTs<\/li>\n<\/ul>\n\n<h4>1.1.0<\/h4>\n\n<ul>\n<li>Support MO translations<\/li>\n<li>Customization using <code>add_filter<\/code><\/li>\n<\/ul>\n\n<h4>1.1.0<\/h4>\n\n<ul>\n<li>WPML and Polylang compatibility added.<\/li>\n<\/ul>\n\n<h4>1.0.2<\/h4>\n\n<ul>\n<li>Update documentation.<\/li>\n<li>Change labels and slugs.<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Plugin created.<\/li>\n<\/ul>","raw_excerpt":"Small addon for ACF Options. Adds ACF location for each custom post type. New feature in the major version 2! Important! After update to v2+ you must &hellip;","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/sa.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/49587","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sa.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/sa.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/sa.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=49587"}],"author":[{"embeddable":true,"href":"https:\/\/sa.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/tusko-trush"}],"wp:attachment":[{"href":"https:\/\/sa.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=49587"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/sa.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=49587"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/sa.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=49587"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/sa.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=49587"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/sa.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=49587"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/sa.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=49587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}