How to give members access to their own protected page?

funtion add_profile_page(){ $title_of_page = “page name”; if( null == get_page_by_title( $title_of_page ) ) { $post_id = wp_insert_post( array( ‘comment_status’ => ‘closed’, ‘ping_status’ => ‘closed’, ‘post_author’ => ‘1’, ‘post_name’ => ‘namehere’, ‘post_title’ => $title_of_page, ‘post_status’ => ‘publish’, ‘post_type’ => ‘page’ ) ); update_post_meta($post_id, ‘_wp_page_template’, ‘mycustomprofile’); } } add_filter( ‘after_setup_theme’, ‘add_profile_page’ ); your template page /* Template … 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

What is the best way to insert links indepently of the permalink structure?

When writing html in the code, if you use <a href=”https://wordpress.stackexchange.com/questions/111843/<?php echo get_permalink(123); ?>”></a> The url outputted is http://www.site.com?p=123 if you deactive pretty permalinks or, if you active pretty permalinks it change automatically according to your permalink structure. You never have to hardcoding url in Worpress when writing html in plugin / template files. If … Read more

Update user from external script

It sounds like you are updating the user information after the form has been displayed. You need to rearrange your code so that you are updating the user information earlier, before the form is displayed. If you need help figuring out how to do that, then you need to share some more details about how … Read more

CSV file header

You may want to considering using the WP Ultimate CSV Importer Plugin instead with this you can map the different fields in the CSV to the columns in wordpress (source: wordpress.org)