Hooking get_pages()

I find the way, but it doesn”t work for my case because the plugin uses another function to link to parent pages, without using get_pages()so the result is so inconsistent. But the filter is working. // Get all posts with the meta key ‘not_in_menu’ function get_not_in_menu_posts() { $post_ids = wp_cache_get( ‘wl_not_in_menu’ ); if ( false … Read more

Getting all post/page IDs related to a soon-to-be-deleted tag/cat

In this function the earliest hook is “delete_term_taxonomy”. However, it seems like the relationships are already deleted before this hook fires. According to the source, ‘delete_term_taxonomy’ runs just before deletion and ‘deleted_term_taxonomy’ runs just after. There are other things going on before this code, like the child relationships are changed. do_action( ‘delete_term_taxonomy’, $tt_id ); $wpdb->delete( … Read more

Change event firing in wordpress

Using transistion_post_status I’m able to retrieve post meta. add_action( ‘transition_post_status’, ‘post_published’, 10, 3 ); function post_published( $new_status, $old_status, $post ) { if ( $old_status != ‘publish’ && $new_status == ‘publish’ ) { $meta = get_post_meta($post->ID); echo ‘<pre>’; var_dump($meta); echo ‘</pre>’; die(); } }

Problem in register activation hook and Copying folder

You are defining the recurs_copy() function to perform the copy but you never execute it. Try: function hyperbolic_activate() { $src=”https://wordpress.stackexchange.com/questions/112547/includes/myTheme/”; $dst=”../themes/”; recurs_copy($src, $dst); } register_activation_hook( __FILE__, ‘hyperbolic_activate’ ); function recurs_copy($src,$dst) { $dir = opendir($src); @mkdir($dst); while(false !== ( $file = readdir($dir)) ) { if (( $file != ‘.’ ) && ( $file != ‘..’ )) … Read more

Hook into create_category

You could use the get_term_by() function: http://codex.wordpress.org/Function_Reference/get_term_by // get the category object $category = get_term_by( ‘id’, $category_id, ‘category’); // use the object to get your values $name = $category->name; $slug = $category->slug; Does this help?

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)