We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [post-meta]

Post meta is a data set containing additional core as well as custom post information.

Filter by
Sorted by
Tagged with
1
vote
1answer
26 views

get_post_meta() not work for the first post inside the loop

I need to add a different custom class to each div inside my wordpress loop. I've read about post_class() function and filter, but I'm not sure if it's a good approach to do this. For now I have this ...
0
votes
1answer
22 views

“Enable Media Replace” plugin does not update serialized object in WPMeta

We utilize WooCommerce and a WooCommerce plugin called Product Documents (https://woocommerce.com/products/product-documents/) to associate PDF media files with products in my online store. Our ...
0
votes
1answer
24 views

Custom Field used to allow a Free Story; no longer works

Have a news site and until recently, there were two ways to get behind the paywall legitimately. First was with a user/pass that was checked against a remote database and returned an AUTH value of yes ...
0
votes
1answer
27 views

Show posts from WP Custom Post Type selected from a field in a metabox

Maybe, the question is unclear for you, but I will try to explain. There are two registered custom post types, song and album. I have a metabox on a Create an Album, in which I can select one post ...
0
votes
0answers
17 views

Show post updated date instead of published in shapely theme [closed]

I am using shapely theme and I would like to show post updated date instead of published date. I tried to update this file, where I replaced this: $time_string = '<time class="entry-date ...
0
votes
0answers
50 views

Issue on Getting Custom Field Value Added To the Custom Taxonomy

I am able to add a Cutom Field to The Custom Taxonomy and save it using the following code. I checked the database and the result is saving into the wp_options table like and when I try to get the ...
0
votes
0answers
19 views

I created a Custom Meta Box but it is not displaying the value on my post page

So i created a custom meta box, here is the code : add_action( 'add_meta_boxes', 'register_meta_box' ); function register_meta_box(){ add_meta_box( 'author_email', 'Author Email Id', '...
0
votes
1answer
12 views

Duplicate rows in meta table, any known relations in WC?

I am doing a migration from very old to current wordpress/woocommerce and while investigating the data I found out that there are more than one row for a products _stock meta key. The same for other ...
0
votes
1answer
21 views

How to retrieve all meta data directly from the $post object? Such as $post->related_topics?

I set up a meta field related_topics that I use to associate lesson topics to a custom post type lesson. I read here https://stackoverflow.com/questions/19640850/wordpress-how-to-return-meta-with-...
1
vote
0answers
7 views

What is proper way to store info such as user marking a post as favorite? In post meta or user meta?

I have custom post types such as course, lesson, and lesson_topic and I have ajax call to mark a lesson_topic as favorite for a user. I am currently doing this in the ajax handler: function ...
0
votes
1answer
11 views

Adding Facebook's image and meta description retrieval capabilities to a WordPress post

When a URL is shared on Facebook, Facebook is able to automatically pull a relevant image and the meta description for use in the post. Would it be possible to code similar functionality into ...
-1
votes
1answer
14 views

add multiple values (array) to post meta_input

i have a custom post type where a post is generated by a form submit. One key is an array which should be stored in a custom field... i shortended the code below to the important part -> they key is "...
0
votes
2answers
21 views

exclude posts with a specific custom field and value

How can I exclude posts with a specific custom field and value with this query? $my_query = new WP_Query( $args = array( // It should be in the first category of our post: '...
0
votes
1answer
8 views

What is proper filter or hook action to add data to the $post object?

I have a custom post type that has a one to many relationship with another custom post type. Call them lesson and topics. Currently, I get $topics as $args = array( 'meta_key' => '...
0
votes
1answer
11 views

Performance considerations - postmeta table versus new table for custom posts with foreign keys?

I am modifying a plugin that uses various custom posts types. The types are courses lessons topics At course, lesson, or topic level there can also be quizzes and assignments. ALso the ...
0
votes
0answers
20 views

Display Yoast field meta description

I found two topic about this issue but neither response exhaustively. How can I show Yoast Desciption in my code with variables? When I'm showing data directly from wordpress function get_post_meta()...
0
votes
0answers
12 views

Using meta data to retrieve related posts - a way to use nested relations?

I am modifying a site that currently has various custom post types. The structure of one to many relationships is basically course lesson lesson topic lesson quiz topic quiz There ...
0
votes
1answer
26 views

why is my postmeta table is so heavy

One of my database is realy heavy (+100Mo) for a site with not so many content (like 40 pages & 10 posts)). I found in phpmyadmin that my table "postmeta" is 95Mo. So i wonder to know what are the ...
0
votes
1answer
58 views

Why can my filter query SOME metadata but not other metadata?

I'm stumped by what seems like a simple task: I want to randomly select a post that fits certain criteria (metadata set by a specific plugin) and then return that random post to the plugin in question....
0
votes
2answers
37 views

Set Multiple Meta Values as an Array Using dispatch( 'core/editor' ).editPost() Call in Gutenberg/JS

I'm attempting to store both an Image's URL and ID in a post's meta field via a Gutenberg component, but am having trouble figuring out how to store those multiple values in an array. I can store a ...
0
votes
1answer
15 views

Show a text if the post has written by author user role in Wordpress

I search a PHP code what is show a certain text or html code on the post page when the post author is an author. (not admin or editor) When the post author is an admin or editor then show nothing. ...
0
votes
0answers
13 views

Get and Update Most Meta Value as an array in HTML form

I'm trying to update post meta for a meta edd_download_files the meta is in the form of an array. It is from a plugin so i can do it via admin, but still there is need to do it programmatically. $...
0
votes
0answers
10 views

Metadata icon/background

How can I add a background image or color to the metadata and change the clock icon? I don't really know css so I have been trying and searching for an answer whole day and couldn't find any, so I ...
0
votes
0answers
15 views

wplink dialog add metadata to field link

Am looking to modify the wplink dialog popup, so that i can add a custom metadata link from post_type portfolio. I found this post that adds a checkbox But not sure how to go about this for what i ...
0
votes
0answers
21 views

blank page with wp_get_attachment

I want to use the function "wp_get_attachment" but when I use it, my website shows me a blank page while my server locally, the function shows me what I want... I went through the canvas without ...
0
votes
0answers
60 views

Help to add Meta to Elementor

Elementor are really great useful and easy editor, but it lacks of possibility to add a custom meta, for example likes from ULikes plugin etc. For WP and Elementor exist some powerful plugins that ...
0
votes
1answer
32 views

Filter for author list in gutenberg core editor

Is there a filter to modify the presentation of certain editor editor components? For my example, I want to be able to filter the author list which is a select input in the Gutenberg editor on the ...
0
votes
1answer
19 views

Hide author from search results meta, still display date and categories

How can I hide just the author from the post meta in search results, while keeping the date and categories? I know I can use something like: .post-meta .author { display: none; } to hide the author ...
0
votes
0answers
10 views

in WordPress Loop update_user_ meta with Current Month and Year as Meta_Ley

I am making a page for my wordpress authors to see there stats. For the same, i first loop through all author ids, then i loop through all of there posts, and sum the post views meta key for all. I ...
1
vote
1answer
25 views

Get Current User Id Inside a Loop Returns 0 For a Shortcode

I am having function, which has a loop for all the posts of given author. I use get_current_user_id() but that does not seem to work while inside a loop, or may be the shortcode troubles it. My ...
0
votes
1answer
23 views

Creating an archive page or simple template to list all values of a custom field of specific post type listing

I have a custom post type named 'lawyer' and it contains various custom fields. two of the custom fields are 'state' and 'city'. i want to create a archive page or simple page(anyone will do) which ...
0
votes
2answers
19 views

Fix common misspellings/errors based on array of replacements

I'm trying to set up a function to fix common content errors on a site. I want to take an array of post fields $check_fields and check them for common errors as set up in an array called $...
1
vote
2answers
99 views

how can I register a post_meta field in an existing CPT and then call it again with get_post_custom()?

I would like to add a post_meta (test_meta_1234) field to an existing CPT (organizer) of an external plugin. With register_meta() it doesn't work. But a taxonomy I can add to the same CPT with ...
0
votes
1answer
40 views

Peepso: Add extra data field (custom post meta) to postbox

I know that this can be edited in the Peepso core, but I want to be able to update the plugin. I think I found a filter I can use to edit the postbox and allow another field. The form is for the ...
0
votes
0answers
26 views

update_post_meta() throws Uncaught error: Cannot create duplicate attribute

In my plugin I'm creating a post of a custom post type. Immediately after creation I'm trying to update some of the metadata that I've defined in metaboxes for this CPT. Upon execution of the code, ...
0
votes
1answer
18 views

Where is get_post_meta value located?

I'm working on a wordpress website created quite long ago. In the header file I see the following code: <?php query_posts("page_id=63"); while ( have_posts() ) : the_post() ?> <?php echo ...
0
votes
1answer
17 views

Remove empty terms from array, sort alphabetically, update back to repeating field

I have a repeating field that stores text terms in an array, like this: [0] => [1] => NUC Lights [2] => Smoke Alarm [3] => Binoculars You'll note key A has no value, and they're not ...
0
votes
0answers
13 views

Automatically update woocommerce products after 10 minutes when they are published from frontend

Is there a function than can update a woocommerce product in 10 minutes after it's published from frontend? I'm asking because i'm running Rh frontend publish pro for users to submit products to ...
0
votes
1answer
26 views

Can't set custom meta fields for a post

I am trying to add some custom meta variables to a custom post type, but I can't see the new variables when I dump a posts meta data, and I can't access it in Here is the post definition from my ...
1
vote
0answers
62 views

get_post_meta returning no value in custom post type alert email

I am working on a function that will alert a user via email when a custom post type (glossary_post) has been created on the frontend of my site. It is working well except I need to get the value of a ...
0
votes
0answers
16 views

Simplest way to clear specific wp_postmeta value via a button

I have a submenu in the Admin Tools tab that shows a wp_postmeta record that has been used to capture error logs. I want a simple button to clear the record. Should I use javascript and send a REST ...
0
votes
0answers
19 views

How can I use a custom template to load custom post type posts based on a post_meta value

I have a CPT which saves a location and and its slug into wp_postmeta table. The location is selected from a dropdown in CPT edit page and it is not a taxonomy. Now I want to create a custom template ...
0
votes
0answers
11 views

Update an App registration form with wp_update_user” or “update_user_meta

on my App registration form i have username, password, email and city as input field, two checbox(Client and Customer) and a list of item. I used $userdata = array( 'user_login' => $name, ...
0
votes
1answer
30 views

Saving Custom Field that includes Quotation marks

I have created a custom field in woocommerce that needs to be saved as 10"x10"x10". This is a measurement and needs to have the double quotation marks. I will display this in a custom tab on the ...
0
votes
1answer
37 views

get_post_meta / update_post_meta array

I am trying to save the ID of the current user (if user is logged in) within an array in a post_meta key called "post_is_read" in every post the user reads so I can perform certain actions such as ...
0
votes
1answer
30 views

How to save a Woocomerce metabox input as a metadata field

I have a plugin that adds videos in place of the featured image of Woocoemerce products. The plugin just adds the video URL and saves it within the product. I would like to provide the saved URL via ...
0
votes
1answer
28 views

update_post_meta Not Processing Array Data (Not Sure What I Am Missing)

Thanks in advance to anyone and everyone who is taking the time to respond. So here is what I am trying to achieve: Essentially I am trying to create a plugin to just edit all the meta descriptions on ...
0
votes
1answer
42 views

get_post_meta and add_post_meta not working

I have a code like below but it returns the false. There is data in $ggowlccpy_transaction_details_capture and the order id is being correctly passed. This is for woocommerce order meta. I don't ...
0
votes
1answer
40 views

Issues Updating Post Meta with AJAX (Seems simple but cannot figure it out)

First and foremost - thank you to anyone and everyone who is taking the time to respond. I am a newer developer and I am sure I have a misunderstanding or something simple that I am missing. I have ...
0
votes
0answers
25 views

Meta data being pulled from wp-login.php

I'm having some trouble with meta data on my WordPres site. I have meta tags in the head of my page and they work well, but for some reason when the link is shared on LinkedIn direct chat, it looks ...