Adding an email column to a Custom Post Types Admin Screen?

May be you can try this: add_filter(‘manage_edit-movie_columns’, ‘custom_add_new_columns’); function custom_add_new_columns( $columns ){ $columns[‘author_email’] = ‘Email’; return $columns; } add_action(‘manage_movie_posts_custom_column’, ‘custom_manage_new_columns’, 10, 2); function custom_manage_new_columns( $column_name, $id ){ if (‘author_email’==$column_name){ $current_item = get_post($id); $author_id = $current_item->post_author; $author_email = get_the_author_meta( ‘user_email’, $author_id); echo ‘<a href=”https://wordpress.stackexchange.com/questions/158706/mailto:”.$author_email.'”>’.$author_email.'</a>’; } } Here, I have used custom post type movie. You need … Read more

Create subpage /user/ or /my-profile/ like /author/ with additional query like /user/user123

If I understand you well, you can do that with add_rewrite_rule(); function to map the url to specific query variables. https://codex.wordpress.org/Rewrite_API/add_rewrite_rule function myfunc_rewrite_rules() { add_rewrite_rule(‘user/?([^/]*)’, ‘index.php?pagename=user&username=$matches[1]’, ‘top’); } function myfunc_username_query_vars($vars) { $vars[] = ‘username’; return $vars; } add_action(‘init’, ‘myfunc_rewrite_rules’); //add query vars (username) to wordpress add_filter(‘query_vars’, ‘myfunc_username_query_vars’); function myfunc_display() { $userpage = get_query_var(‘pagename’); $username = … Read more

How to get input_attrs in the sanitize function?

Your control is named custom_num but your setting is named my_custom_num. Modify your setting’s sanitize function to use the former: $input_attrs = $setting->manager->get_control( ‘custom_num’ )->input_attrs; See also the Customize Input Validity Constraints plugin, where you can see how to obtain the control for a given setting without having to hard-code it: $controls = array(); foreach … Read more

How to extend a class in WordPress?

I can’t tell you what you’re doing wrong with your includes and such, but your method of extending the class is basically correct. However, the most likely scenario that I can see is that your add_action is basically executing in the wrong place. Also, you’re doing-it-wrong by allowing the original action to stand instead of … Read more

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