Custom Meta Box (SELECT2) Not Saving Taxonomy Terms

I have the code, enter image description here

/*  * Add a metabox  * I hope you're familiar with add_meta_box() function, so, nothing new for you here  */ add_action( 'admin_menu', 'rudr_metabox_for_select2_cat' ); function rudr_metabox_for_select2_cat() {     add_meta_box( 'rudr_select2', 'Tune Category', 'rudr_display_select2_cat_metabox', 'post', 'side', 'high' ); } /*  * Display the fields inside it  */ function rudr_display_select2_cat_metabox( $  post_object ) {     // I decided to write all the metabox html into a variable and then echo it at the end     $  html = '';      // always array because we have added [] to our <select> name attribute     $  appended_cat = get_post_meta( $  post_object->ID, 'rudr_select2_cat',true );      /*      * It will be just a multiple select for tags without AJAX search      * If no tags found - do not display anything      * hide_empty=0 means to show tags not attached to any posts      */     if( $  cats = get_terms( 'category', 'hide_empty=0' ) ) {         $  html .= '<p><select id="rudr_select2_cat" name="rudr_select2_cat[]" single="single" style="width:99%;max-width:25em;">';         foreach( $  cats as $  cat ) {             $  selected = ( is_array( $  appended_cat ) && in_array( $  cat->term_id, $  appended_cat ) ) ? ' selected="selected"' : '';             $  html .= '<option value="' . $  cat->term_id . '"' . $  selected . '>' . $  cat->name . '</option>';         }         $  html .= '<select></p>';     }     echo $  html; } add_action( 'wp_ajax_mishagetcat', 'rudr_get_cat_ajax_callback' ); // wp_ajax_{action} function rudr_get_cat_ajax_callback(){      // we will pass post IDs and titles to this array     $  return = array();      $  cat = get_terms( array('taxonomy' => 'category','search'=> $  _GET['q'],'ignore_sticky_posts' => 1,));         foreach ( $  cat as $  cat ) {               // shorten the title a little             $  title = ( mb_strlen( $  cat->name ) > 50 ) ? mb_substr( $  cat->name, 0, 49 ) . '...' : $  cat->name;             $  return[] = array( $  cat->term_id, $  title ); // array( Post ID, Post Title )         }     echo json_encode( $  return );     die; } //auto_save add_action( 'save_post', 'rudr_save_metaboxdata', 10, 2 ); function rudr_save_metaboxdata( $  post_id, $  post ) {      if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) return $  post_id;      // if post type is different from our selected one, do nothing     if ( $  post->post_type == 'post' ) {         if( isset( $  _POST['rudr_select2_cat'] ) )             update_post_meta( $  post_id, 'rudr_select2_cat', $  _POST['rudr_select2_cat'] );         else             delete_post_meta( $  post_id, 'rudr_select2_cat' );         if( isset( $  _POST['rudr_select2_tags'] ) )             update_post_meta( $  post_id, 'rudr_select2_tags', $  _POST['rudr_select2_tags'] );         else             delete_post_meta( $  post_id, 'rudr_select2_tags' );     }     return $  post_id; } //add_script_&_stylesheet add_action( 'admin_enqueue_scripts', 'rudr_select2_enqueue' ); function rudr_select2_enqueue(){      wp_enqueue_style('select2', '' );     wp_enqueue_script('select2', '', array('jquery') );      // please create also an empty JS file in your theme directory and include it too     wp_enqueue_script('mycustom', get_template_directory_uri() . '/css/mycustom.js', array( 'jquery', 'select2' ) );   } 

enter image description here But Showing only deafult category.

WordPress hook after post content and meta update

I want to update one of my meta field and redirect and I am using post_updatedhook. Here is my code.

function job_publish_status( $  post_ID, $  post_after, $  post_before ) {    $  job_published_date = get_the_time("Y-m-d", $  post_ID);    $  expire_date = date('Y-m-d', strtotime($  job_published_date. ' + 60 days'));    update_post_meta($  post_ID, '_job_expires', $  expire_date);    $  url = get_site_url();    $  url = $  url.'/wp-admin/post.php?post='.$  post_ID.'&action=edit';    wp_redirect( $  url );    exit;  } add_action('post_updated', 'job_publish_status', 99, 3 ); 

It is updating this _job_expires meta field and redirecting correctly. When I edit post content and title, its updates title and content but it is not updating other meta fields in this post. Is there any hook which triggers after post content update and meta fields update ?

Besides regex and serialization, is there or are there any more meta logical-patterns?

I understand that text processing could be done in various ways on top of operating systems:

  • Shell utilities for processing a file (and/or a file name): tr, sed, awk, perl, mv and others

  • text editors for processing a file (and/or or a file name): nano, vim, Emacs and others; whether CLUI/TUI/GUI and whether for “plain” or “rich” text

  • Possible shell builtins: such as compgen to to generate auto-completion matches for specified commands and others

I understand that generally all of these programs can be empowered by meta logical-patterns (and programs) such as regex or serialization (such as JSON key-value pairs).
Besides regex and serialization, is there or are there any more meta logical-patterns?

How to display “META” array in register_taxonomy

How do I get the “META” field to go off “META: []” for something filled in? I am using this code:

register_taxonomy( 'job_listing_category', 'job_listing', [             'labels' => [                 'name'              => _x( 'Categories', 'Category taxonomy labels', 'my-listing' ),                 'singular_name'     => _x( 'Category', 'Category taxonomy labels', 'my-listing' ),                 'menu_name'         => _x( 'Categories', 'Category taxonomy labels', 'my-listing' ),                 'search_items'      => _x( 'Search Categories', 'Category taxonomy labels', 'my-listing' ),                 'all_items'         => _x( 'All Categories', 'Category taxonomy labels', 'my-listing' ),                 'parent_item'       => _x( 'Parent Category', 'Category taxonomy labels', 'my-listing' ),                 'parent_item_colon' => _x( 'Parent Category:', 'Category taxonomy labels', 'my-listing' ),                 'edit_item'         => _x( 'Edit Category', 'Category taxonomy labels', 'my-listing' ),                 'update_item'       => _x( 'Update Category', 'Category taxonomy labels', 'my-listing' ),                 'add_new_item'      => _x( 'Add New Category', 'Category taxonomy labels', 'my-listing' ),                 'new_item_name'     => _x( 'New Category Name', 'Category taxonomy labels', 'my-listing' ),             ],             'rewrite' => [                 'slug' => $  permalink_structure['category_base'],                 'with_front'   => false,                 'hierarchical' => false,             ],             'hierarchical'          => true,             'update_count_callback' => '_update_post_term_count',             'show_ui'               => true,             'show_tagcloud'         => false,             'public'                => true,             'show_in_rest'          => true,         ] ); 

Meta_query on same meta key, with diffrenct values

i’m trying to get_users with the meta_query where i need to find users where either they don’t have the meta key, or it is blank.

It seems like everywhere i look, i should be able to use the OR on the relation and then use the same meta key, but how ever i set it up, it does not work.

My code:

$  ors[] = array(    'key'   => 'death_date',    'compare' => '=',    'value' => '',    'type' => 'NUMERIC'                     ); $  ors[] = array(    'key'   => 'death_date',    'compare' => 'NOT EXISTS'                     );  $  args = array(    'meta_query' => array(    'relation' => 'or',    $  ors, ));  $  return = get_users($  args); 

Both of them work separately, but not together.

l’ll do Shopify Store SEO optimization, Product Tags, Meta Description, Alt Tags and Schema Markup for $20

Shopify Store SEO optimization is the process of optimizing each and every product and page of your store in order to rank higher in the Search Engine Results Pages (SERPS). If you want to enhance Shopify Store ranking, organic web traffic and sales, you simply can’t ignore search engine optimization(SEO). This White Hat on page SEO services can boost google ranking of your Shopify Store or Store traffic by 90% or more. Our on page SEO optimization services include: Free: Shopify Store SEO analysis and Store SEO audit report.LSI, Focused & Long tail keywords Optimization.Install & configure necessary store apps.Compelling Meta descriptions, SEO Meta Titles and Product tags.Heading tags (H₁, H₂, H₃), Image alt tags and Shopify store Speed Optimization.Fix duplicate content & Redirect Broken Links to the Homepage or Parent Page.Social media Meta tags, Hyperlink and anchor text optimization.Search Engines friendly URLs and SEO Titles.Schema Markup, XML Sitemaps, Internal / External Linking and Robots.txt.Webmaster Tools(Google, Bing, Yahoo) & Google analytics. Why us? 100% Client Satisfaction and Money back Guarantee.Increased store authority.Top-ranked website based SEO keywords research.100% White Hat manual work.WordPress SEO, Wix SEO and Shopify Store SEO Specialists.If you have any questions, please don’t hesitate to get in touch. Tags: Shopify SEO, Shopify store SEO, e-commerce store SEO, store optimization, SEO services, Store SEO analysis, Shopify store SEO optimization, Shopify store SEO ranking, Shopify store on page SEO optimization, Shopify store SEO services, Shopify store SEO specialist, Shopify store SEO agency, Shopify store SEO consultant, Product Tags, SEO keyword research, LSI keywords research, Keywords analysis, Shopify store SEO Audit Report, Shopify store SEO audit, 301 redirect, Competitor analysis, Meta descriptions, image alt tags, Shopify store speed optimization, XML sitemap, robots file, hyper link optimization, anchor text optimization, SEO friendly titles, long tail keywords research and Targeted Organic Traffic.

Created: —
Category: Local SEO
Viewed: 197

Facebook Sharing API does not get the PHP echo-ed meta data

I have provided og:meta tags for my page which is filled in by PHP based on the GET id in the request.

The issue is, that when I check out what does the Facebook crawler see when it goes through my page, it gets empty data. All the meta tags are empty, there is no title the page is just loaded with the HTML template but no actual content in it. It sure as hell works when accessed by a normal web browser, most browsers actually.

So what could be the cause for this issue, afaik PHP is not something bots can block like they can block JS, right ?

Check if searched number is within the post meta value

I wrote a function which search a list of properties by specify the number of guests. Each property have a specific number of guests, eg: 10, so if the user search as guests 5 the query should return that post, but my code wouldn’t:

$  guests_tax_array = array(     'taxonomy' => 'property-guests',     'field' => 'term_id',     'terms' => array($  guests), //Searched value from $  _POST['guests']     'compare' => 'IN' ); 

Essentially, the query should check if 5 (searched value) is contained in 10 using the compare operator.

But the result is empty, is something wrong there?