Hot answers tagged

2

I think you are on the right track, but that last part is messy. You are using the bw_add_markup_class function for two different purposes : to return the classes that you want to add to list the context of the filters that you want to call If I understand well want you are trying to do, you need a function to return the array and then apply your ...


1

Try placing $myquery->the_post(); inside your while loop. I think get_the_ID() and get_the_title() depend on that being setup first. Also, wp_reset_query(); should be replaced with wp_reset_postdata();.


1

We can utilize the add_term_relationship action to check if the current post is already assigned as popular. add_term_relationship fires before a term is inserted. I also think that you are using the wrong hook here to send your mail on. added_term_relationship fires quite early before any error checking. You can still encounter a failure after ...


1

You have to use new_to_publish action as described on Post Status Transitions Codex page (updated according @prog comment): add_action( 'new_to_publish', 'pms_post_published_notification', 10, 1 ); function pms_post_published_notification( $post ) { if($post->post_type == 'property') { // custom code here } } The only argument is ...


1

However the below given code works for me. add_action( 'new_to_publish', 'pms_post_published_notification', 10, 1 ); function pms_post_published_notification( $post ) { if($post->post_type == 'property') { // custom code here } } Thanks @Max



Only top voted, non community-wiki answers of a minimum length are eligible