Potential Security Issue in Custom Taxonomy Search Functionality

I’m wishing to add some functionality to a client WordPress site that allows you to include taxonomy terms from custom post types in the WordPress search, and come across the following answer:

Include custom taxonomy term in search

This solution does work, but in the comments a user has mentioned that it’s “probably not a good idea to inject the raw publicly available search string directly into an SQL query.” and added a link for further reading. I can’t see anything in this link that relates to the specifices of the answer though.

For quick reference the code for the answer is below, would this code be a security risk? And if so what would the solution be so you can still have the functionality of being able to include taxonomy terms in the WP search without the security risk?

Many thanks

// search all taxonomies, based on: http://projects.jesseheap.com/all-projects/wordpress-plugin-tag-search-in-wordpress-23  function atom_search_where($  where){ global $  wpdb; if (is_search())     $  where .= "OR (t.name LIKE '%".get_search_query()."%' AND {$  wpdb->posts}.post_status = 'publish')"; return $  where; }  function atom_search_join($  join){ global $  wpdb; if (is_search())     $  join .= "LEFT JOIN {$  wpdb->term_relationships} tr ON {$  wpdb->posts}.ID = tr.object_id INNER JOIN {$  wpdb->term_taxonomy} tt ON tt.term_taxonomy_id=tr.term_taxonomy_id INNER JOIN {$  wpdb->terms} t ON t.term_id = tt.term_id"; return $  join; }  function atom_search_groupby($  groupby){ global $  wpdb;  // we need to group on post ID $  groupby_id = "{$  wpdb->posts}.ID"; if(!is_search() || strpos($  groupby, $  groupby_id) !== false) return $  groupby;  // groupby was empty, use ours if(!strlen(trim($  groupby))) return $  groupby_id;  // wasn't empty, append ours return $  groupby.", ".$  groupby_id; }  add_filter('posts_where','atom_search_where'); add_filter('posts_join', 'atom_search_join'); add_filter('posts_groupby', 'atom_search_groupby'); 

Gutenberg Featured-Image-panel missing when user with custom role edits Custom Post Type

For a WordPress project I made a Custom Post Type in the usual manner. Also i made a custom role. I want users with that role to be able to make, edit and delete this CPT. I added the apropriate capabilities to this role. These are the caps:

'level_1' => true, // seems necessary to asign this author as a post_author by other users 'read' => true, 'view_admin_dashboard' => true, 'upload_files' => true, 'publish_{my_cpts}' => true, 'edit_{my_cpts}' => true, 'edit_others_{my_cpts}' => false, 'delete_{my_cpts}' => true, 'delete_others_{my_cpts}' => false, 'read_private_{my_cpts}' => true, 'edit_{my_cpt}' => true, 'delete_{my_cpt}' => true, 'read_{my_cpt}' => true 

I map these capabilities also in the args for adding the cpt. Upon making the CPT, I did not forget to add ‘thumbnail’ to the ‘supports’ argument. And i added theme-support for thumbnails, also for my cpt

However, i don’t want users with this role to be able to edit ordinary posts.

I think i don’t need to provide more details on this because everything works fine.

Except for the featured image panel in Gutenberg. This panel seems to display only if a user has the edit_posts capability, which my users don’t have. The panel shows for other users, it only remains hidden for users with my custom role.

For now, I made a workaround with an ACF-image field. Images uploaded with this custom field I make the featured-image in a save_post hook.

But this is a workaround, I prefer the usual panel. Any suggestions? I find this an unusual hard nut to crack.

Bootstrap-4 carousel is ignoring my custom css

Below are the carousel arrows which are part of a larger carousel object which I'm trying to customise through my external custom.css:

<!-- Left and right controls --> <a class="carousel-control-prev" href="#demo" data-slide="prev"> <span class="carousel-control-prev-icon"></span> </a> <a class="carousel-control-next" href="#demo" data-slide="next"> <span class="carousel-control-next-icon"></span> </a>
Code (CSS):

I've, in fact, even tried overqualifying the .carousel-control-next-icon…

Bootstrap-4 carousel is ignoring my custom css

Add custom admin menu item for pages using a certain template

I am looking to add a new, custom menu item to the WordPress admin sidebar that displays pages that use a certain template. For example: a group of pages uses the template called “Retailer Sendout” (page-retailer-sendout.php) would be displayed below the default “Pages” top-level menu item.

I have tried the following URL combinations, but none of them have worked so far.

  • http://domain.test/wp-admin/edit.php?post_type=page&page_template=page-retailer-sendout
  • http://domain.test/wp-admin/edit.php?post_type=pagetemplate=page-retailer-sendout
  • http://domain.test/wp-admin/edit.php?post_type=page&page_template=retailer_sendout

I have also tested some admin menu customization plugins, but they do not offer the ability to link to pages with a specific template name.

I am comfortable with adding a custom function to the theme’s functions.php file, but I do not know where to start.

Any help is greatly appreciated.

revenuelite.com premade custom PTC/GPT site With Revenue Shares

– This is our new branch of pre-made sites at auroracoderz.com, this will be to allow our clients a worry free PTC/GPT sites, we will provide you script/domain/hosting/template so you can get a ready to go site without problems

– This site includes :

1- Domain: revenuelite.com [ Registered at namecheap, valid till Dec 6, 2020 ]
2- SSL certificate which will be activated once buyer provide the info to generate it
3- AuroraCoderz Deluxe Script V 2.9.6 [ With 1 year license and free updates ]…

revenuelite.com premade custom PTC/GPT site With Revenue Shares

How to automatically set ‘default image size’ for specific Custom Post Type

I’m looking to automatically set the default image size in the WordPress WYSIWYG, but only on certain Custom Post Types. For example, my CPT ‘products’ would default to ‘medium’, and CPT ‘staff’ would default to ‘full’.

I’ve used the following code below to update media sizes for all CPT’s, not just a specific one. Is this possible?

Here is the code I’m using for site-wide definitions:

function custom_image_size() {   update_option('image_default_size', 'full' ); }  add_action('after_setup_theme', 'custom_image_size'); 

How to add the custom code to the particular category in WordPress

I am trying to add the script to the particular product category, but the code is not adding it to the category.

This is my code for the page (This is working):

function wpb_hook_faq_javascript() {   if (is_single ('8') || is_page ('8')) {      ?>     <script type="application/ld+json">      </script>   <?php } } add_action('wp_footer', 'wpb_hook_faq_javascript'); 

And I am trying to add this similar code to the product category page:

function wpb_hook_faqtocategory_javascript() {   if ( in_category( 'category-name' )) {      ?>     <script type="application/ld+json">      </script>   <?php } } add_action('wp_footer', 'wpb_hook_faqtocategory_javascript'); 

But the above code is not working. This is my product category URL: wp-admin/term.phptaxonomy=product_cat&tag_ID=9&post_type=product.

Any help is much appreciated.

Create Custom Map

Hello friends, i need create custom map for my website but I do not know how. Need somting like this https://www.createaclickablemap.com/ .
I have these files https://drive.google.com/drive/folders/1oTeZxo3-Ii9iVqUtSkLp__bEMS4WEGz0?usp=sharing