Tagged: settings
- This topic has 5 replies, 2 voices, and was last updated 4 years ago by
Steve.
-
AuthorPosts
-
-
January 15, 2018 at 2:53 pm #8677
lulicoParticipantI followed the tutorial on here, no dice, rather confused. Developing a plugin. I have custom fields added to my WooCommerce products successfully, and to attributes thereof. But the settings I can’t get to happen.
myplugin.php contains the following:
add_filter('piklist_admin_pages', 'woocustom_admin_pages'); function woocustom_admin_pages($pages) { $pages[] = array( 'page_title' => __('Reseller Settings') ,'menu_title' => __('Reseller', 'reseller-settings') ,'sub_menu' => 'options.php' ,'capability' => 'manage_options' ,'menu_slug' => 'woocustom_reseller' ,'setting' => 'reseller_settings' ,'menu_icon' => piklist('url', 'piklist') . '/parts/img/piklist-icon.png' ,'page_icon' => piklist('url', 'piklist') . '/parts/img/piklist-page-icon-32.png' ,'default_tab' => 'Basic' // ,'layout' => 'meta-boxes' // NOTE: Uncomment this to use the meta box layout on this settings page! ,'save_text' => 'Save' ); return $pages; }Then in myplugin/piklist/parts/settings/reseller-settings.php is this block of brilliance:
/* Title: Linens Reseller Settings Setting: reseller_settings */ piklist('field', array( 'type' => 'checkbox', 'field' => 'show_site_here', 'label' => 'Display Your Website on our Network Directory Page', //'value' => 0, // default 'choices' => array( 1 => 'OK', ) ) );What’s wrong with this scripture?
-
January 16, 2018 at 12:05 pm #8679
SteveKeymasterInstead of
options.php, did you meanoptions-general.php? -
January 17, 2018 at 9:31 am #8682
lulicoParticipantWhat do you know, it works. I can’t believe I didn’t try that. Thank you kindly.
Now that that’s there, my parts/settings/reseller-settings.php is not in effect. Its header-comment has
Setting: reseller_settingsand the page options has got its'setting' => 'woocustom_reseller'. Why is my checkbox missing?Also how can I set the menu order? I tried adding
'menu_order' => 1to the page options array, no dice.Thanks much.
-
January 17, 2018 at 12:30 pm #8683
-
January 17, 2018 at 12:58 pm #8685
lulicoParticipantSorry I wrote that wrong, the settings do match; it’s
Setting: woocustom_reseller, doesn’t show though. -
January 26, 2018 at 6:19 pm #8701
-
-
AuthorPosts
- You must be logged in to reply to this topic.