The tag has no wiki summary.

learn more… | top users | synonyms

0
votes
1answer
24 views

Add post tag without post id

How can I add a new Tag without an post-id? wp_set_post_tags() needs a Post-Id, but a client want import Post-Tags without assignment to a post (for choosing later into the posts).
0
votes
1answer
65 views

WordPress object for comments frame [closed]

For two days I have tried to make this code work. I want to add a comment frame in single.php. I got this code to put it in the single page's template: <script type="text/javascript" ...
0
votes
2answers
95 views

What is the action hook that deletes a taxonomy term from the backend? And how to retireve the term id before deleting it?

I need to delete some postmeta when deleting taxonomy terms from the backend. Before deleting the term, I need to retrieve the postmeta's meka_key and the term id that is going to be deleted. Use the ...
-1
votes
1answer
52 views

How can I get the term_id from the action hook 'set_object_terms'?

I have the following code and I want to use the term_id inside that function. I aware that the variable $terms contains the term; however, I do not know how to get the term id from it. ...
0
votes
1answer
49 views

Set unique term_id from custom meta keys

I have a function to set a custom meta keys values to a taxanomy, term. $category20 = $fields['field_52dd3aa1d6bc0']; // gps wp_delete_object_term_relationships( $post_id, 'gps' ); ...
0
votes
1answer
68 views

Removing a taxonomy term

There is a Wordpress function called wp_remove_object_terms that unfortunatly doesn't seem to work. I am trying to achieve the same ends using the following $post_terms = wp_get_object_terms( ...
0
votes
1answer
46 views

How to add terms (without deleting others)

I have a form on my site that allows signed in users tag products from the front-end of the site in a basic form. I am using Woocommerce as the commerce platform. Woocommerce uses Custom Post Types ...
1
vote
1answer
140 views

Programmatically add posts add and assign postmeta and assign terms

I have thousands of WooCommerce products that need to be inserted into the database. For some reasons I can't use the csv import plugin or any other 3rd party solution and this has to be done manually ...
0
votes
1answer
63 views

Trying to use wp_set_object_terms while supplying an array for both term id, and texonomies

I'm trying to use wp_set_object_terms ref : http://codex.wordpress.org/Function_Reference/wp_set_object_terms while passing array for both the terms and taxonomy for some reason i keep getting : ...
0
votes
1answer
27 views

Pass custom value to custom taxonomy

I'm trying to pass a custom field value into a custom taxamony whenever I publish a post. Everything works fine except the meta value part. I can only pass strings. In the codex it says that ...
2
votes
1answer
152 views

Automatically assign taxonomy term if custom meta value exists

I currently have a custom meta field for adding a video url to the post. I'd like for the existing taxonomy term "video" to be automatically assigned to the post upon saving if the meta field has any ...
0
votes
1answer
519 views

Wp set post terms not work

My code is not working, it does not add the taxonomy add_action('init', 'post_test', 10); function post_test() { $empty = get_page_by_title('Produto teste', OBJECT, 'produtos'); ...
0
votes
2answers
317 views

Custom Taxonomy dont save in a frontend form for post a custom post

I have a Dropdown Categories .. <?php wp_dropdown_categories('taxonomy=faenas_combenef_category&hide_empty=0&orderby=name&order=asc&name=location') ?> And my post Process... ...
0
votes
1answer
102 views

Custom terms inserting as single string with commas, not separated

I have a front end form, one of the inputs asks for a comma separated list of keywords which should each end up being a custom term, I just saw in the backend the terms are entered as single string ...
0
votes
1answer
374 views

How to set hierarchical terms to a post using wp_set_object_terms

I have a hierarchical custom taxonomy called "locations". The parent categories are country names, the child categories are the territories under the country. How can i attach these terms to a post ...
3
votes
1answer
1k views

How can I add programmatically custom taxonomy terms to a custom type post when saving posts?

Scenario: there is a 'Recommended Books' section on the website which uses the 'book' custom post type and the 'author' custom taxonomy. I'm using Amazon Product Advertising API for retrieving book ...
0
votes
1answer
55 views

Modify functions.php to add a term 'uses-theme' set to theme name on post save

I need to automatically (without anything visible to the user in the UI and without user intervention) 'mark' a post in a sub-blog with the theme it was set to when the user posted. As I understand ...
2
votes
1answer
601 views

Programmatically insert hierarchical terms & set terms for post causes glitch? [duplicate]

I am inserting an array of terms into my custom taxonomy programmatically. Some terms have parents/children. After each term has been entered, I then insert an array of posts into my custom post type. ...
1
vote
1answer
217 views

Do I have to set parent when set post term?

When save a term which is a child term, if I don't provide specific parent id, will WP make this term's parent 0 ?
3
votes
1answer
247 views

wp_set_object_terms creates relationship to REVISION?

I have a custom post type, 'albums'. In it is a taxonomy, 'album_artist'. I am trying to programatically add artists to that taxonomy using wp_set_object_terms in a function that's hooked into ...
0
votes
2answers
251 views

Adding action to save_post, post needs to be saved twice for function to work

I have written the following function which copies all post terms from the "tribe_events_cat" taxonomy to the "categoria" taxonomy when the post is saved. There is a bug where in order for the terms ...
0
votes
1answer
65 views

merging terms programmatically while maintaining the count

This question is all about finding out the best way to handle merging similar terms. Let's say you have 10 posts tagged as Barack Obama and 20 posts tagged as Obama. and you want to group them all ...
6
votes
1answer
3k views

wp set object terms vs wp set post terms

Examining the following sample code snippet from the WP codex, $post = array( 'ID' => [ <post id> ] //Are you updating an existing post? 'post_author' => [ <user ID> ] //The ...
0
votes
1answer
579 views

Taxonomy Checkbox Admin Panel

I have a basic Admin panel allowing Admin to save options using Checkbox. Checkboxes are used as multiple selection is necessary for the option So, Admin Option - Checkbox 1 - Checkbox 2 - Checkbox 3 ...
0
votes
1answer
245 views

Improving Co-Authors Plus Plugin [closed]

I've been using the Co-Authors Plus plugin for assigning multiple authors to posts. The authors are very particular in the ordering of the names on the public-facing side of the website so I need the ...
1
vote
1answer
498 views

wp_set_object terms won't remove all terms [closed]

I am trying to figure out why wp_set_object terms will update the terms in a given taxonomy but when I set the $terms param to NULL it keeps one of the terms - the one with the lowest ID. I've ...
0
votes
1answer
658 views

wp_set_object_terms not working inside loop

I have the following code $genres= array('action', 'comedy', 'horror'); foreach($genres as $genre){ $ret = wp_set_object_terms( $postId, $genre, 'genres'); } But this code associates only ...
0
votes
1answer
168 views

wp_set_object_terms timing out?

I have a list of 350 or so terms that I am trying to set to a post. Here's my code: add_action('init', 'add_cities_to_story'); function add_cities_to_story() { $cities_list = ...
2
votes
4answers
2k views

wp_set_object_terms() Fails to Set Terms

Okay guys, here's the scenario. I'm am trying to setup a function that will automatically duplicate a post (when published) over to another post type. So, a regular blog post is published, and when ...