Viewing 3 reply threads
  • Author
    Posts
    • #7646
      dameer
      Member

      Hi!
      Not sure whether it’s WP 4.7 or myself but I can’t solve the problem.

      I’ve made a Piklist plugin. The plugin settings page was added to admin menu like this:

      public function kd_admin_menu( $pages ) {
      
      	// add settings page
      	$pages[] = array(
      		'page_title' => NULL, 
      		'menu_title' => esc_attr__( 'Settings', 'kd' ), 
      		'sub_menu' => 'edit.php?post_type=kd',
      		'capability' => 'manage_options', 
      		'menu_slug' => 'general_settings', 
      		'setting' => 'general_settings', 
      		'single_line' => true, 
      		'default_tab' => esc_attr__( 'General settings', 'kd' ), 
      		'save_text' => esc_attr__( 'Save Options', 'kd' )
      	);
      
      	return $pages;
      	
      }

      Under my plugin folder I’ve created “/parts/workflows/” folder which is used to hold plugin settings across 4 tabs. It means that each file represents one tab + header file. Here they are:

      — /parts/workflows/plugin-settings-header.php —

      /*
      Flow: Plugin Options
      Page: edit.php, general_settings
      Post Type: kd
      Header: true
      Position: title
      */

      — /parts/workflows/plugin-settings-general.php —

      
      /*
      Title: Features Panel
      Post Type: kd
      Flow: Plugin Options
      Setting: general_settings
      Order: 10
      */

      — /parts/workflows/plugin-settings-single-post.php —

      /*
      Title: Single Post
      Post Type: kd
      Flow: Plugin Options
      Setting: general_settings
      Order: 20
      */

      — /parts/workflows/plugin-settings-archive.php —

      /*
      Title: Category
      Post Type: kd
      Flow: Plugin Options
      Setting: general_settings
      Order: 30
      */

      — /parts/workflows/plugin-settings-rewrite-rules.php —

      /*
      Title: Rewrite Rules
      Post Type: kd
      Flow: Plugin Options
      Setting: general_settings
      Order: 40
      */

      Of course, each of the files contains Piklist fields which I guess are irrelevant
      in this case.

      Everything looks right, tab switching works fine, however, when I hit Save Options button, I end up with the blank WordPress page saying:
      ERROR: options page not found.

      Is there anything wrong with workflow header?

      Thanks for any clue!

    • #7649
      dameer
      Member

      After a long search I realized where does the error come from… All of WP options/settings must be whitelisted according to codex: https://codex.wordpress.org/Function_Reference/register_setting#Notes . There’s even a filter named “whitelist_options”.
      However, I haven’t seen it being used by Piklist in context of Workflow and Settings so it looks like another bug. Hopefully I’m wrong. Docs are incomplete, no support.
      Without incomplete documentation, too many bugs, no answers and a bunch of unhappy clients I’ll have to give up. Carbon Fields seems like a decent alternative. I’m desperate.

    • #7661
      Steve
      Keymaster

      @dameer– Do the Demo settings work?

    • #7663
      dameer
      Member

      For the sake of good relationship with my clients I decided to switch to Carbon Fields plugin. It’ll take long time to recode all the stuff but that’s something I must do. There’s a great docs behind CF, very few bugs and it’s almost as powerful as Piklist 🙂
      Thanks for your time Steve, you are the man, I wish all the best for you and Piklist in the future!

Viewing 3 reply threads
  • The topic ‘Workflow Settings ends up with "ERROR: options page not found" on save’ is closed to new replies.