Link to user’s profile settings page?
The user edit page of the current user is /wp-admin/profile.php, so you can just do admin_url( ‘profile.php’ ), which is the way it is used in the WP source code.
The user edit page of the current user is /wp-admin/profile.php, so you can just do admin_url( ‘profile.php’ ), which is the way it is used in the WP source code.
Call wp_update_post() with a special value for ‘post_date’ and ‘post_date_gmt’: $time = current_time(‘mysql’); wp_update_post( array ( ‘ID’ => 123, // ID of the post to update ‘post_date’ => $time, ‘post_date_gmt’ => get_gmt_from_date( $time ) ) );
Option 1 As the article linked by @MikeMadern suggests: in your web host control panel, go to PHPMyAdmin select the table wp_comments select Export, configure the format further down in the same screen, select the Save as file and Go Option 2 Or, as the same article suggests, just use a plugin: Export comments Pulls … Read more
If I understand the problem setup correctly, you could try to do the break and widget class counting within the wp_nav_menu_objects filter. Here’s an updated example, it’s rather expanded because of the extra debug part: add_filter( ‘wp_nav_menu_objects’, function( $items, $args ) { // Only apply this for the ‘primary’ menu: if( ‘primary’ !== $args->theme_location ) … Read more
wp_register_sidebar_widget() is part of the old widgets API. Sidebar widgets used to be built procedurally … in a non-reusable fashion (i.e. you could only ever have one of each). register_widget() was introduced with the new Widgets API and takes an object/class as an input rather than actual widget parameters. WordPress can instantiate as many copies … Read more
You can hook onto pre_insert_term, check the taxonomy and whether or not the user has the specified role as follows: function disallow_insert_term($term, $taxonomy) { $user = wp_get_current_user(); if ( $taxonomy === ‘post_tag’ && in_array(‘somerole’, $user->roles) ) { return new WP_Error( ‘disallow_insert_term’, __(‘Your role does not have permission to add terms to this taxonomy’) ); } … Read more
Ok, so I think I may have come to a solution. It doesn’t seem as nice and easy as I’d like it to be, but then again major modifications to default WordPress functionality sometimes requires drastic measures. 🙂 This is my working solution to rewriting the HTML output for post thumbnails throughout my site to … Read more
This will do the trick! add_action(‘trash_post’,’my_trash_post_function’,1,1); function my_trash_post_function($post_id){ if(!did_action(‘trash_post’)){ // do stuff } } Here we add the function, and to prevent the hook from executing more than once using did_action: http://codex.wordpress.org/Function_Reference/did_action As always, these kinds of hooks take the form {post_status}_{post_type}, so trash_post, trash_page, trash_customposttype, publish_page etc
You can use get_stylesheet_directory() to refer to your child theme, then you can point to your file. require_once( get_stylesheet_directory() . ‘/includes/theme-styles.php’ ); It will load your file and replace the parent theme file.
WordPress is old. In fact, it is older than PHP7, in which PHP introduced random_int(). WP wanted/needed this functionality before, so another method was implemented. how does the PHP interpreter understand which of the two functions I’m calling? Good question. The interpreter doesn’t understand this. And hence, if you had PHP7 and would define this … Read more