jet89
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: Detect Terms of Current Post on Savethanks for the notes, i implemented this as well as using wp_get_post_terms instead and the results are as desired!
Thank you for all the help everyone!
Forum: Developing with WordPress
In reply to: Detect Terms of Current Post on SaveSo the current workflow is as follows. I have one function that will create child posts using wp_insert_post and the ‘save_post’ hook when saved prioritized before the included function. After that, I call this function to assign the terms to those child pages.
I updated the code to accommodate the the variable issue but am still getting the same results.
It looks like I am able to get all the children pages and apply the term list however the term list variable returns no values.
revised code below:
<?php
add_action(‘save_post’, ‘assign_parent_terms’,10);function assign_parent_terms($post_id){
global $currentpost;
$currentpost = get_post( $post_id );if(isset($currentpost) && $currentpost->post_type != ‘campaign’){
return $post_id;}// CREATE POST CONDITION
if ( !wp_is_post_revision( $post_id )
&& ‘campaign’ == get_post_type( $post_id )
&& ‘auto-draft’ != get_post_status( $post_id ) ) {
$currentpost = get_post( $post_id );
// get all assigned terms$term_list = wp_get_object_terms( $currentpost->ID, ‘brand’);
//$term_list = wp_get_post_terms( $post->ID, ‘brand’);
$getchilargs = array(
‘post_parent’ => $currentpost->ID,
‘post_type’ => ‘campaign’,
‘numberposts’ => -1,
‘post_status’ => ‘any’
);
$children = get_children( $getchilargs );if(!empty($children)){
foreach ($children as $child){
$childID = $child->ID;
//$childparent = $child->parent;
//$term_list = $post->post_name;
wp_set_object_terms($childID, $term_list, ‘brand’);
}
}}
}
?>Is there a login redirect plugin and or custom log in page plugin that plays nice with this plugin?
Looks like this error only happens for unauthorized users now. If I want a page to be fully public, should i make sure it isn’t included in any rule?
Quick Update: I tried deactivating plugins again and after a few tries, the problem fixed itself again. Is there a more permanent fix for this or is this purely a plugin conflict issue? This doesn’t seem to play well with any login centric/content access plugins.