Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

post-meta

How to check if a post meta key/value pair already exists for a specific post

August 5, 2022 by Magenaut

I want to know if for a given post ID $post_id, there is a metadata key and value pair stored that matches a given key $meta_key and value $meta_value pair.

Categories Q&A, Wordpress Tags meta-query, post-meta Leave a comment

How to get all term meta for a taxonomy – getting term_meta for taxonomy

August 5, 2022 by Magenaut

TL;DR: I’m trying to get the meta_value display_type for a taxonomy, but it returns blank (even though I can see it in the database).

Categories Q&A, Wordpress Tags meta-value, post-meta, terms, wpdb Leave a comment

How to detect that the save_post hook is calling the callback associated to the current edit post page only

August 5, 2022 by Magenaut

I am using the save_post hook to handle updates in a post that are done via the admin edit post page.

Categories Q&A, Wordpress Tags custom-post-types, post-meta, save-post Leave a comment

Change post author without using wp_update_post()

August 5, 2022 by Magenaut

The standard or more obvious way to change a post author in WP is to use the wp_update_post() function, as shown in this question.

Categories Q&A, Wordpress Tags author, post-meta, posts, save-post Leave a comment

Should I sanitize custom post meta if it is going to be escaped later?

August 5, 2022 by Magenaut

Firstly, sorry if this has been properly answered before. After reading a lot of questions and guides, I’m still not totally convinced on the best way of doing things.

Categories Q&A, Wordpress Tags post-meta, sanitization Leave a comment

Ajax: Populate with content from a post’s ID not working – duplicating current page html instead

August 5, 2022 by Magenaut

Ok guys and gals, I’m losing my mind here…

Categories Q&A, Wordpress Tags ajax, jquery, plugin-development, post-meta, theme-development Leave a comment

How to improve my non-unique metadata MySQL entries?

August 5, 2022 by Magenaut

I’m working on a plugin for WooCommerce which uses a cpt called Restock. In a Restock post you can enter products ( id ) plus restock. The user can add as many product restock pairs as they want per post.

Categories Q&A, Wordpress Tags custom-field, meta-query, metabox, mysql, post-meta Leave a comment

WP_POSTMETA changes site crash

August 5, 2022 by Magenaut

I try to update wp_postmeta from SQL script.

Categories Q&A, Wordpress Tags post-meta, sql Leave a comment

Update Post Meta for a logged in user

August 5, 2022 by Magenaut

I have created a form which collects information which I want to update a post with. The code I have works great, but instead of updating a post for the user, it creates a new one. Not sure what I am missing to get the current post to update instead of creating a new post. Here is the code I am using:

Categories Q&A, Wordpress Tags custom-field, custom-post-types, post-meta, posts Leave a comment

Ordering posts by anniversary using only day and month

August 5, 2022 by Magenaut

I defined a custom field named crimedate using standard date format Y-m-d. I defined the filters to make ordering by this date work in the post list of the backend, which works fine.

Categories Q&A, Wordpress Tags custom-field, date, meta-query, order, post-meta Leave a comment
Older posts
Newer posts
← Previous Page1 Page2 Page3 … Page9 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress