Automatic Logout on from another active session

Answer has been updated because don’t need to write function, only use wp_destroy_all_other_sessions function with initlike this add_action(‘init’, ‘wp_destroy_all_other_sessions’); Developed its plugin and publish on WordPress Download here :One Active session

Remove Container Element From wp_nav_menu() Markup

FYI :container => ” is a string operation and it’s default set by div you can’t use true or false like bool expression. Just change the container => ‘ul’ then i hope you will get what you want to see. for more details please read this : https://developer.wordpress.org/reference/functions/wp_nav_menu/ Thanks Musa

How to change the markup WordPress inserts for post images

As far as I know you could hook into the filter image_send_to_editor like this: function html5_insert_image($html, $id, $caption, $title, $align, $url) { $url = wp_get_attachment_url($id); $html5 = “<figure id=’post-$id media-$id’ class=”align-$align”>”; $html5 .= “<img src=”https://wordpress.stackexchange.com/questions/231693/$url” alt=”$title” />”; $html5 .= “</figure>”; return $html5; } add_filter( ‘image_send_to_editor’, ‘html5_insert_image’, 10, 9 ); For additional tags like data-pil-thumb-url and … Read more

How to influence the information displayed on widget inside wp-admin

Background: The reason why filtering with dynamic_sidebar_params doesn’t work with HTML is because WordPress strips HTML from Widget Heading in wp_widget_control() function like this: $widget_title = esc_html( strip_tags( $sidebar_args[‘widget_name’] ) ); WordPress also strips HTML in default JavaScript in wp-admin/js/widgets.js So without a customised solution, there is no default filter or option either with PHP … Read more

How to show product SKU on product page

Add this to your functions.php add_action( ‘woocommerce_single_product_summary’, ‘dev_designs_show_sku’, 5 ); function dev_designs_show_sku(){ global $product; echo ‘SKU: ‘ . $product->get_sku(); } This will output the product SKU below the product title. See image below. The product SKU is VERTEX-SLVR.

paginate_links() don’t properly work in search.php?

I’m fairly certain this is answered elsewhere, but I’ll add it here again. I believe your issue lies here: ‘current’ => max( 1, get_query_var(‘paged’) ), Try this instead: global $wp_query; $wp_query->query_vars[‘paged’] > 1 ? $current = $wp_query->query_vars[‘paged’] : $current = 1; …then: ‘current’ => $current; Your ‘base’ may also be an issue. Instead of this: … Read more

Remove a menu item created by a plugin

function remove_submenu() { remove_submenu_page( ‘edit.php’, ‘edit-tags.php?taxonomy=faq-topic&post_type=question’ ); remove_submenu_page( ‘edit.php’, ‘edit-tags.php?taxonomy=faq-tags&post_type=question’ ); } add_action( ‘admin_menu’, ‘remove_submenu’, 999 ); Please read the Codex. remove_submenu_page() need two parameters and the right hook. And very important: Use a very, very, very high priority in your hook! If you use a low priority, your function will be executed before the … Read more

Sort posts by Date (DESC) and by Title (ASC)

You can pass an array to the query as the following example described in the Codex shows: $args = array( ‘orderby’ => array( ‘title’ => ‘DESC’, ‘menu_order’ => ‘ASC’ ) ); $query = new WP_Query( $args ); In your case will be something like this: /* Order Posts Alphabetically */ function prefix_modify_query_order( $query ) { … Read more