Where is the content of widgets stored in mysql table

Widget options are stored in the options table under ‘sidebars_widgets’ as a serialized array. See this post for a longer explanation. Changing the field per PHPMyAdmin is not recommended, use PHP, get_option() and update_option() instead, WordPress will take care for correct serialization then.

Give Editor Access To Sidebar

The edit_theme_options capability should allow the user to edit the sidebar as described on this page : http://codex.wordpress.org/Appearance_Widgets_SubPanel Code to add to functions.php $role = get_role(‘editor’); $role->add_cap(‘edit_theme_options’); Edit: This should work to prevent editor accessing themes or menus function custom_admin_menu() { $user = new WP_User(get_current_user_id()); if (!empty( $user->roles) && is_array($user->roles)) { foreach ($user->roles as $role) … Read more

What is the difference with get_sidebar and dynamic_sidebar?

Please refer to the get_sidebar() and dynamic_sidebar() Codex entries. The get_sidebar( $slug ) template tag includes the sidebar-$slug.php template-part file. The dynamic_sidebar( $slug ) template tag outputs the $slug dynamic sidebar, as defined by register_sidebar( array( ‘id’ => $slug ) ).

List all sidebar names?

Loop through the global: <select> <?php foreach ( $GLOBALS[‘wp_registered_sidebars’] as $sidebar ) { ?> <option value=”<?php echo ucwords( $sidebar[‘id’] ); ?>”> <?php echo ucwords( $sidebar[‘name’] ); ?> </option> <?php } ?> </select> Note: The ucwords() function is only there to display it exactly as you asked. Not sure if you really want that. How to … Read more

Limit number of Widgets in Sidebars

I solved this in Javascript. If you want to completely prevent it you should also do it server-side, because you can edit the widgets with Javascript disabled (try it out!). The different sidebars are checked when you drop widgets to them or away from them. If they become full, the background color changes and you … Read more

Get list of all registered sidebars

Hmm… I’m not sure if this is the best way to do it but it’s simple: I looked in register_sidebar() and found that new sidebars are simply tacked onto an array:$wp_registered_sidebars And I guess that’s that. If they ever change the name of the variable, I guess I’d be screwed.

Loading scripts only if a particular shortcode or widget is present

You can use the function is_active_widget . E.g.: function check_widget() { if( is_active_widget( ”, ”, ‘search’ ) ) { // check if search widget is used wp_enqueue_script(‘my-script’); } } add_action( ‘init’, ‘check_widget’ ); To load the script in the page where the widget is loaded only, you will have to add the is_active_widget() code, in … Read more

Programmatically add widgets to sidebars

When I started this answer it should be just a small note. Well, I failed. Sorry! Stay with me, there is a goody hidden deep down … How WordPress widgets are stored The list of widget is stored in an option named ‘sidebars_widgets’. A var_export() may give something like the following: array ( ‘wp_inactive_widgets’ => … Read more

Which banner plugin is this? [closed]

That would be revslider http://codecanyon.net/item/slider-revolution-responsive-wordpress-plugin/2751380 Warning, last year there was some information about it having a vulnerability on wordpress websites. The 2 websites I had it pre installed on via themes have also broken due to a update in rev slider requiring me to go in and amend the rev slider code to disable it. … Read more