Articles of options

Insufficient permissions to save options

Hi I have built a settings page which from the menu leads to: The problem is that when I go to save the options and I am an EDITOR user I get this error: You do not have sufficient permissions to access this page. I am using User Role Editor plugin and edit_theme_options capability […]

Add a series of checkboxes to theme options

Hi I made a theme options by this tutorial This options have multicheck type by checkboxes. I don’t know how to make it work. I’m try to exclude page using this multicheck. This is my array with options: $pages = get_pages(‘sort_column=post_parent,menu_order’); $pageids = array(); foreach ($pages as $page) { $pageids[$page->ID]= $page->post_title; } array( “name” => […]

Default Plugin Settings Not Writing to Database

I have my plugin setup as such: Main plugin file mouldings.php <?php /* Plugin Name: Moulding Profiles Plugin URI: Description: Creates a ‘Moulding Profiles’ and ‘Idea Gallery’ custom post type, creates a ‘Wood Types’ and ‘Categories’ taxonomy for ‘Moulding Profiles’ Version: 0.1 Author: Author URI: License: GPL2 */ // Global Variables $mouldings_prefix = ‘mouldings_’; $mouldings_name […]

Include user defined styles without including wp-load

I’ve looked through the answers on here and none quite match my situation. I have custom CSS that a user can edit and it is saved in the options. I use wp_enqueue_style to include a PHP file with a CSS content header and then load the CSS from the options. However, in order to load […]

Add get_option to jquery

I have created a settings page that contains various radio button options for a custom plugin. A radio button I’ve created is to ‘display dots’ with the values yes or no. I can get use the value any other time except in the jQuery function below. I would like to get the value of the […]

Plugin options not being saved or created

Having a lot of trouble with this config page. I have followed the documentation (which was sparse) and done a bit of searching for help. My problem is simple, my config options aren’t being created or saved. Any help would be much appreciated! Here’s the general set-up: public $view; function __construct() { $this->view = new […]

Proper use of option_page_capability_{$page_name}

I am having trouble giving access to an options page to Editors. I am pretty sure I need to use the filter option_page_capability_{$page_name} but it is not working for me. Is there a specific place to hook this? I am still getting the Cheatin’, uh? error with this: function bf_ins_capability(){ return ‘edit_posts’; } add_filter( ‘option_page_capability_brightfire-insurance-settings’, […]

Settings API – how to update multiple options manually?

I’m storing all my options using Settings API: function registerSettings() { register_setting(‘XX_theme_settings’, ‘XX_theme_settings’, ‘setting_validate’ ); add_settings_section(‘theme_options’, ‘Theme Options’, ‘theme_options_generate’, ‘page1’ ); add_settings_field( ‘XX_Option1’, ‘Option 1’, ‘text_input’, ‘page1’, ‘theme_options’, ‘XX_Option1’ ); add_settings_field( ‘XX_Option2’, ‘Option 2’, ‘text_input’, ‘page1’, ‘theme_options’, ‘XX_Option2’ ); }; add_action(‘admin_init’, ‘registerSettings’); Let’s say I want to update all the options manually (not using forms, […]

How to debug register_setting callback function

I am using the following code: register_setting( ‘myplugin_options’, //setting group name ‘myplugin_options’, //option name that will be stored in the database ‘myplugin_validate_options’//optional callback function ); function myplugin_validate_options($input) { //how can i print $input to the screen or view the output of this function for debugging purpsoses? } I just need to know how we can […]

display all posts in wordpress admin crashing after 999 screen option

I decided to change the option on wordpress > posts > screen options > show posts to 999. now the page crashes when i open it . it loads for a little bit and then it crashes. how can i undo the changes . please help.