_toggle_sticky example

// Flag the post date to be edited.             $post_data['edit_date'] = true;
        }

        if ( ! isset( $post_data['ID'] ) ) {
            $post_data['ID'] = get_default_post_to_edit( $post_data['post_type'], true )->ID;
        }
        $post_id = $post_data['ID'];

        if ( 'post' === $post_data['post_type'] ) {
            $error = $this->_toggle_sticky( $post_data$update );
            if ( $error ) {
                return $error;
            }
        }

        if ( isset( $post_data['post_thumbnail'] ) ) {
            // Empty value deletes, non-empty value adds/updates.             if ( ! $post_data['post_thumbnail'] ) {
                delete_post_thumbnail( $post_id );
            } elseif ( ! get_post( absint( $post_data['post_thumbnail'] ) ) ) {
                return new IXR_Error( 404, __( 'Invalid attachment ID.' ) );
            }
Home | Imprint | This part of the site doesn't use cookies.