Is it possible to add nonce tag to inline scripts for wordpress sites using ? I have used a filter script_loader_tag + function for adding tags before but it adds nonce tag only to with src tag. Unfortunately I cant add nonce tag to inline javascript automatically :( So I need a script for some filter which would add nonce tag automatically to tag.
Thanks to some wonderful help here at stack exchange, I have built a comment section with a dropdown menu that adds comment_meta to the comments. I currently have a working filter that uses GET to trigger an if statement to query based on this comment_meta info. The thing I don't like is that it refreshes the page each time you click a button. I'm looking for a way to filter without having the page refresh. I think I need Javascript …
When adding category to Menu, I need it to list all the item that belong to that category in separate UL automatically. like this http://i.stack.imgur.com/ulOOS.jpg Of course I can do that manually, but I'm look for a way to add a filter, maybe, to the wp page menu function, but Im not sure how its can be done. I'm using thematic child theme Thank you.
Question: How to filter uppercase and lowercase when the word 'tag' is written in lowercase? and vice versa, how to filter the word 'tag' which is written in capital letters? Here's the code I got from a plugin that hasn't been updated in a few years. function auto_link_tags($content){ //$post_id = get_the_ID(); $post_tags = get_the_tags(); if ($post_tags) { $i = 0; foreach($post_tags as $tag) { $tags[$i] = "~<(?:a\\s.*?</a>|[^>]+>)(*SKIP)(*FAIL)|\\b(?:\\b(" . $tag->name . ")\\b(?=[^>]*(<|$)))\\b~i"; $tag_url = get_tag_link($tag->term_id); $tag_html[$i] = '<a href="' . $tag_url …
I have a custom built site that does not use usernames and everything requires use of their email address. The username is auto generated and looks bad in the table. I know there are filters and actions to work with custom columns within the users table but I have been looking for a way to replace the username with the email address. I know I can unset the username using manage_users_columns filter but I then loose the row actions. Is …
I would like to display the posts when I click on an item with the dropdown select Currently, my select is OK, all my terms are displayed and all posts too. I just want to know of it's possible to filter This is my dropdown select : <select name="soins-taxonomy"> <option value="all">Tout afficher</option> <?php // Get the taxonomy's terms $terms = get_terms( array( 'taxonomy' => 'location', 'hide_empty' => false, 'exclude' => 1 ) ); // Check if any term exists if …
I am using the jet filter plugin to filter posts, After applying a filter, I want the "apply filter button" to redirect me to single post template of filtered post ( not on archive page for where the posts listing is shown ) Any one can help me with code?
I am sorting results appear on the category archive page using these filters: posts_join and posts_orderby. There is a widget, which displays recent posts. I am using default recent posts widget of WordPress. But it's not showing any result. When I investigated I found that the applied filters are getting applied to this query. So, I tried remove the filters using the following code: remove_filter('posts_join', 'my_filter_join'); remove_filter('posts_orderby', 'my_filter_orderby'); But still it does not work. I also tried to put the …
I like this solution from Ahmad M, a lot, but how do I add images in addition to titles, instead of replacing titles? (Sorry, I'm still pretty new to PHP and Stackexchange). Pulling Featured Images in to a WordPress Menu I mostly figured it out. I'm using Ahmad M's filter but needed to add ".$menu_object->title" to the thumbnail so now it looks like: $menu_object->title = has_post_thumbnail($menu_object->object_id) ? get_the_post_thumbnail($menu_object->object_id, 'full') . $menu_object->title . : $menu_object->title; Now my challenge is that I …
My project: Wordpress, Woocommerce, Bootstrap 4, bs4navwalker My problem: Custom dropdown item added by WP filter. I have one navbar, 3 differents menus inside (using bs4navwalker), a badge for the cart and a search form. See code. I'm using a filter (add_filter( 'wp_nav_menu_items',) to add login, logout and myaccount details in my navbar, everything is ok, but i'd like to add these items inside a dropdown. The filter just creates one or two more items to the 'user' menu. I …
I'm displaying users (authors) on a page. how can I add a filter based on user custom feilds? <?php // THE USER QUERY ARGS $args = [ 'role' => 'author', 'number' => -1, ]; // THE USER QUERY $user_query = new WP_User_Query($args); // THE TOTAL SUBSCRIBERS NUMBER echo '<h3 class="font-weight-bold">Total Listed Shops: ' . $user_query->get_total() . '</h3>'; echo '<hr>'; // THE USER LOOP if (!empty($user_query->get_results())) { foreach ($user_query->get_results() as $user) { // ACF PREFIX & FIELD DATA FROM USER PROFILE …
I am having some issues determining the solution to this problem below. The website was sent to our team to fix. Turned on error reporting in wp-config.php: define('WP_DEBUG', true); WordPress version: 5.3.2PHP version: 7.2 WordPress Theme: Grow Pro Fatal error: Uncaught Error: Class 'WP_Block_Styles_Registry' not found in /home/website/public_html/clientsite.com/wp-includes/script- loader.php:2902 Stack trace: #0 /home/website/public_html/clientsite.com/wp-includes/class-wp- hook.php(288): enqueue_block_styles_assets('') #1 /home/website/public_html/clientsite.com/wp-includes/class-wp- hook.php(312): WP_Hook->apply_filters(NULL, Array) #2 /home/website/public_html/clientsite.com/wp-includes/plugin.php(478): WP_Hook->do_action(Array) #3 /home/website/public_html/clientsite.com/wp-includes/script- loader.php(2856): do_action('enqueue_block_a...') #4 /home/website/public_html/clientsite.com/wp-includes/class-wp- hook.php(288): wp_common_block_scripts_and_styles('') #5 /home/website/public_html/clientsite.com/wp-includes/class-wp- hook.php(312): WP_Hook->apply_filters(NULL, Array) #6 /home/website/public_html/clientsite.com/wp-includes/plugin.php(478): WP_Hook->do_action(Array) #7 …
I can current filter the content type of the wp_mail function: add_filter( 'wp_mail_content_type', function( $content_type ) { return 'text/html'; }); And I can filter the message content add_filter( 'wp_mail', function( $args ) { $args['message'] = 'Filtered text here'; return $args; }); But how can I only do the latter conditionally? I only want to filter the message when the content type == text/plain. I'm guessing there is a super-simple solution to this, but I haven't worked it out yet.
I am trying to configure WordPress 5.9 to allow numeric slugs for child pages. Drawing from the 2015 answer to a similar question I took the up-to-date code of wp_unique_post_slug, removed || preg_match( "@^($wp_rewrite->pagination_base)?\d+$@", $slug ) and then added it as the following hook to my theme's functions.php. But for some reason, I just get a critical error: "Allowed memory size exhausted". What can I do to allow numeric slugs for child pages? add_filter( 'wp_unique_post_slug', function ( $slug, $post_ID, $post_status, …
I'm developing a simple plug in and I need to filter single_cat_title in category page adding some html in every category page. Just doing this: function subtitleCategory ($title) { return $title."</div></div></div><div class=\"container_24\"><h2 id=\"category-subtitle\">TEST1</h2></div>"; } add_filter('single_cat_title', 'subtitleCategory'); I get what I need. But I noticed that this filter also apply to the breadcrumbs (there is a call in breadcrumbs.php) and this means twice in the same page (not what I need). Do you know if there is a condition that can …
I have been looking for an answer for a few days digging through hooks and actions. I just cane seem to find a way to turn down the strength on the reset password page not sure if its through woo-commerce or WP I have tried the following add_filter( 'woocommerce_min_password_strength', 'reduce_woocommerce_min_strength_requirement' ); function reduce_woocommerce_min_strength_requirement( $strength ) { return 2; } add_filter( 'wc_password_strength_meter_params', 'reduce_strength_meter_settings' ); function reduce_strength_meter_settings( $data ) { return array_merge( $data, array( 'min_password_strength' => 2, 'i18n_password_hint' => 'Change Hint here' …
I have Used the function dynamic_sidebar('sidebarId') in the sidebar.php file. and all the functionality of the sidebar is Working succsessfully My Question is How To Change the Html of the sidebar widgets and add some classes in widget items To fit My Design ? Thank You in advance