Support

Account

Home Forums Add-ons Options Page Use revisions with "Options Page"

Solved

Use revisions with "Options Page"

  • I have the full version of ACF. Is there a way to add the “revisions” feature on an “Options Page”?

    For example I use this in my functions file to create the options page. But when I go to the options page “my post page” there is no link to view revisions like regular posts have under publish box on the top right.

    	acf_add_options_sub_page(array(
    		'page_title' 	=> 'my post page',
    		'menu_title'	=> 'my post page',
    		'parent_slug'	=> 'theme-general-settings',
    		
    	));

    Thanks

  • Options pages are not like posts and do not have revisions. Options pages are admin pages and the values are stored in the wp_options table. These work just like admin pages created using standard WP features https://codex.wordpress.org/Creating_Options_Pages. Having the ability to do this would mean adding an entire interface to WP that does not currently exist.

    If you want the ability to have revisions and do what you’re looking for I would suggest creating a custom post type that will hold all of your options pages, although this will probably be a lot of work and will remove the ability to add options pages into places like the appearance menu.

  • Thanks for the clarification of what is happening. That is helpful and makes sense.

    Thanks

  • Is there any way or plugin so we can have revisions in options table nowadays?

  • @omikr0n The idea is to create custom post type with hidden UI and hide it from front-end, link edit post from this cpt in options page or directly in admin menu under custom position like: ‘themes.php’ and save options there rather than real options page.
    To get the valuer You’ll need only to check the ID of the post named like “Global Options” or another one with “Theme Options” (eg. post Global Options ID = 8797 – You’ll need to use get_field(‘field_name’, ‘8797’));
    You can make it even more clever, but it’s basic idea.

  • Thanks a lot for the smart workaround

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.