With WP 3.4 customizer, while using postMessage & working within your JS for one option, can you retrieve current value for another option?

What you could do is the following : // ———————————————————- // Primary Typograpy // ———————————————————- var current; /* Primary Typography – Size */ wp.customize(‘typography_primary_size’, function( value ) { current.size = value; value.bind(function(size) { $(‘h1, h2, h2, h4, h5, h6’).css(‘font-size’, size); }); }); /* Primary Typography – Face */ wp.customize(‘typography_primary_face’, function( value ) { current.face = … Read more

Getting the different post statuses + count like in edit.php, in a custom submenu page

The class used in edit.php is an extension of the WP_List_Table: WP_Posts_List_Table. See wp-admin/includes/class-wp-posts-list-table.php. And here you find a call to wp_count_posts( $type=”post”, $perm = ” ). The first parameter is for the post type, the second can be empty or readable. If it is readable and the current user has no permission to see … Read more

remove_action with profile_personal_options

Sometimes you need to get a little creative when customizing the WordPress admin area. It’s often possible to do it without CSS, but it isn’t always straightforward: understanding what’s happening on the source files and digging through the many functions called in the ifs and elses is a must. Here’s something slightly hacky I came … Read more

get_template_part in admin

Yes, get_template_part() does work on Admin pages. Here is how I tested: Add this to functions.php theme (or child theme) file: add_action( ‘admin_menu’, ‘wpse_99662_register_admin_test_page’ ); function wpse_99662_register_admin_test_page() { add_menu_page( ‘Admin Test Page’, ‘Admin Test Page’, ‘manage_options’, ‘admin_test_page’, ‘wpse_99662_admin_test_page’ ); } function wpse_99662_admin_test_page() { echo ‘<h2>Admin Test Page</h2>’; get_template_part( ‘admin’, ‘test’ ); } The admin-test.php file … Read more

Add tabbed menu to admin page

if you don’t like this method. maybe you would like the follow code: you can try to put the follow code in your functions.php file- // Theme options /* get options & set default options */ if( !function_exists(‘share3h_theme_get_options’) ) : function share3h_theme_get_options($option){ $share3h_theme_options = get_option(‘share3h_theme_options’); if( !$share3h_theme_options || array_key_exists($option, $share3h_theme_options) ) : $share3h_theme_default_options = array( … Read more

Having admin on different host breaks attached images

you can configure the tinymce to use relative paths for images using the tiny_mce_before_init like this: function tinymce_relative_path( $init ) { $init[‘relative_urls’] = true; $init[‘document_base_url’] = ‘http://www.mysite.com’; return $init; } add_filter(‘tiny_mce_before_init’, ‘tinymce_relative_path’);

How can I activate Collapse Menu in WordPress?

You have to trigger the click event. Try, jQuery(document).ready(function() { jQuery(“#collapse-menu”).trigger(‘click’); }); Update: Use the following code to check if menu is already folded, if not trigger click event to fold it. jQuery(document).ready(function() { if ( !$(document.body).hasClass(‘folded’) ) { jQuery(“#collapse-menu”).trigger(‘click’); } });

Custom taxonomy admin page

Not sure why I didn’t think of this earlier. I suppose I was hoping for a way to ‘hijack’ the default page to display something else… Anyway following my original method: If you want a custom admin page for a taxonomy, you can set ‘show_ui’ => false when you register it to suppress the default … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)