How can I add data to a custom column in the Users section of the wordpress backend?

manage_users_custom_column is a filter hook, so you should use add_filter() and not add_action(). Which also means you should return the output instead of echoing it. The column name is the second parameter and not the first one — which is the current value for the current column. So try with: function last_name_value($output, $column_name, $user_id) { … Read more

What’s the easiest way to periodically (automatically) read static Markdown content into a WP page?

I achieved that using WP-Cron capabilities. add_action(‘wp’, ‘wpse_26170_activation’); function wpse_26170_activation() { if ( !wp_next_scheduled( ‘wpse_26170_update_readme_page’ ) ) { wp_schedule_event( current_time( ‘timestamp’ ), ‘daily’, ‘wpse_26170_update_readme_page’); } } function wpse_26170_update_readme_page() { $page = array( ‘ID’ => 767, ‘post_content’ => Markdown( file_get_contents( ‘path/to/readme.markdown’ ) ) ); if ( // Filters return true if they existed before you removed … Read more

Force pdf download not working when include blog-header.php

I think WordPress is having problem with the url of your external script and throws a 404 error from the handle_404() function in the wp class in /wp-includes/class-wp.php You can try to overcome that using for example status_header(200) <?php define(‘WP_USE_THEMES’, false); require(‘../wp-blog-header.php’); status_header(200); header(‘Content-type: application/octet-stream’); header(‘Content-Disposition: attachment; filename=”file.pdf”‘); readfile(‘file.pdf’); ?> ps: It is informative to … Read more