Send specific users an email when posts are published

Do you know if your wp_mail() function is working at all? Do you know whether or not your function isn’t failing higher in the chain? I’d re-write the function like this, which makes it a little easier to read and also slightly more efficient as we are only running functions that we absolutely need to … Read more

WP 3.4 has missing photo data

Having figured out the issue, I’d like to update this question. The issue stems from previous versions of WP not including the _wp_attached_file meta key when uploading media, which 3.4 now seems to require. Below is PHP code for looping through the database, verifying the presence of both the key and image file, then updating … Read more

add_sub_menu page() to be replaced by add_theme_page()

Themes are required to use add_theme_page() in the WordPress Theme Directory. You need: add_theme_page( $this->strings[‘page_title’], // Page title $this->strings[‘menu_title’], // Menu title ‘edit_theme_options’, // Capability $this->menu, // Menu slug array( &$this, ‘install_plugins_page’ ) // Callback ); s add_theme_page(theme_name.’ Settings’, theme_name ,’install_themes’, ‘panel’ , ‘panel_options’); $theme_page = add_theme_page(‘Settings’, theme_name.’ Settings’,’install_themes’, ‘panel’ , ‘panel_options’); add_theme_page(theme_name.’ Documentation’, ‘Documentation’,’install_themes’, … Read more

Using a _GET gives me a debug error (over my head)

The error is occurring as the $_GET array doesn’t have the item $_GET[‘do’] in it. Therefore it throws this notice. To check if something exisits in the array try: if( isset( $_GET[‘do’] ) ) $do_that = $_GET[‘do’]; else $do_that=””; or a cleaner method would be to use short hand notation $do_that = ( isset( $_GET[‘do’] … Read more

Undefined index error when saving content on metabox

Resolved by following comment on Tutsplus Tutorial (link included): In function save_meta(), replace this line: if (!wp_verify_nonce($_POST[‘custom_meta_box_nonce’], basename(__FILE__))) with this line: if (!isset($_POST[‘custom_meta_box_nonce’]) || !wp_verify_nonce($_POST[‘custom_meta_box_nonce’], basename(__FILE__))) See full comment here.

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