Can’t get wp_insert_post to work

That is because you’re trying to define a property that is already defined, query a table with a wrong name, loop through an integer while you can use get_results instead of query method of $wpdb … I edited the code, hope it will help with your post duplication process: defined( ‘WP_USE_THEMES’ ) || define( ‘WP_USE_THEMES’, … Read more

WPML – Set language of inserted post

The wpml_set_element_language_details action element_type need to be with the correct prefix that WPML use: From the WPML Docs element_type(string) The type of an element. Can be a post type: post_post, post_page, post_attachment, post_nav_menu_item, post_{custom post key} or taxonomy: tax_category, tax_post_tag, tax_nav_menu, tax_{custom taxonomy key}. Defaults to post_post if not set. In your case it should … Read more

Can’t publish post using ajax

To those who are experiencing the same issue, there are few steps to take to determine the culprit. Create posts manually in the WP Dashboard area (set it to future) .. and manually publish (look for the error in the log). step 1 and trash the post, in the Trash, try reverting that post (this … Read more

add_menu_page Callback Function: Skip page content?

add_action( ‘admin_menu’, ‘av_subscribe_create_menu’ ); function av_subscribe_create_menu() { $hook = add_menu_page( ‘Add Comment Feed’, ‘Add Comment Feed’, ‘manage_options’, ‘av-create-feed’, // Don’t use __FILE__ as the slug, keep it short ‘n sweet! ‘__return_true’ // We need a callback otherwise WP won’t properly handle the page, though it’s never seen ); if ( $hook ) // Current user … Read more

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