‘pre_user_query’ interfering with user export

‘users’ != $current_screen->id in your file $current_screen is not set therefore, you are getting warning. You can pass custom var in your user query and check before running your code. $blogusers = get_users( ‘orderby=nicename&order=ASC&my_filter=1’ ); Here we are passing my_filter=1 then later we can check in pre_user_query global $wpdb, $current_screen; $vars = $user_search->query_vars; if (isset($current_screen->id) … Read more

How to edit the styles for the table of pages/post listed in the admin when you click on pages/posts?

I guess you are in edit.php so you can add style only for this admin page. function enqueue_my_scripts($hook) { if ( ‘edit.php’ != $hook ) { return; } //our script to remove fixed table class echo ‘<script>’; echo ‘$( “.wp-list-table” ).removeClass( “fixed” )’; echo ‘</script>’; } add_action( ‘admin_enqueue_scripts’, ‘enqueue_my_scripts’ ); The explanation is basic first … Read more

Foreach implode issue

Change it to: <?php $guiones = rwmb_meta( ‘mb_guionistas’, array( ‘multiple’ => true) ); $pieces = array(); foreach ($guiones as $item) { $pieces [] = ‘<a href=”‘ . get_bloginfo(‘url’) . ‘/?p=’ . $item . ‘” title=””>’ . get_the_title( $item ) . ‘</a>’; } echo implode(‘, ‘, $pieces); ?> bloginfo() echos values while get_bloginfo() returns values.

Restrict characters in comment section

Never edit the WordPress core files. Instead you should hook into the pre_comment_content, which is where the comment text from the textarea is being sanitized, before it’s inserted into the database. In the example below preg_replace is used to sanitize the comment text submitted. You should modify the function to fit your needs. function keha_filter_comment( … Read more

WordPress PHP syntax doesn’t seem to be working correctly

get_the_post_thumbnail() returns the full html output of the image, including the image <img /> tags. You want just the image src. Try this: <div class=”leftBox”> <?php $query = new WP_Query( ‘pagename=jour’ ); // The Loop if ( $query && $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post(); if ( has_post_thumbnail() ) { $img_src = … Read more

jQuery accordion menu

Add the menu_class argument with value of cd-accordion-menu to your code, so that it looks like this: <div class=”menu-container”> <nav id=”site-navigation” class=”main-navigation” role=”navigation”> <?php wp_nav_menu(array( ‘theme_location’ => ‘primary’, ‘sort_column’ => ‘menu_order’, ‘menu’ => ‘Categories’, ‘container_class’ => ‘main-menu’, ‘menu_id’ => ‘primary-menu’, ‘menu_class’ => ‘cd-accordion-menu’ ) ); ?> </nav><!– #site-navigation –> </div><!– #menu-container –> You can see … Read more

Warning: call_user_func() expects parameter 1 to be a valid callback, function

I just found the solution. use this code instead public function register_voguepay_woocommerce_payouts_dashboard_widget(){ add_meta_box( ‘withdraw_to_bank’, ‘Withdraw to Bank’, array($this, ‘voguepay_woocommerce_payouts_dashboard_widget_display’), ‘dashboard’, ‘side’, ‘high’ ); } public function voguepay_woocommerce_payouts_dashboard_widget_display(){ echo “Hello World, I’m a great Dashboard Widget”; }