WordPress交流讨论群组

press this 自定义发表文章

0 replies, 1 voice 最后回应 果舍网的头像 果舍网 1 year, 7 months ago
  • Author
    Posts
  • #27125
    果舍网的头像
    果舍网
    Keymaster
    @guoshe


    add_action( 'wp_ajax_press-this-save-post', function()
    {
    add_filter( 'wp_insert_post_data', function( $data )
    {
    if( isset( $data['post_type'] ) && 'post' === $data['post_type'] )
    $data['post_type'] = 'cpt'; //

    return $data;
    }, PHP_INT_MAX );

    }, 0 );

You must be logged in to reply to this topic.