plugin author.', 'simpletags' ), 'error' );
return false;
}
if ( isset( $_POST['tags'] ) ) {
$counter = 0;
foreach ( (array) $_POST['tags'] as $object_id => $tag_list ) {
// Trim data
$tag_list = trim( stripslashes( $tag_list ) );
// String to array
$tags = explode( ',', $tag_list );
// Remove empty and trim tag
$tags = array_filter( $tags, '_delete_empty_element' );
// Add new tag (no append ! replace !)
wp_set_object_terms( $object_id, $tags, SimpleTags_Admin::$taxonomy );
$counter ++;
// Clean cache
clean_post_cache( $object_id );
}
add_settings_error( __CLASS__, __CLASS__, sprintf( __( '%1$s %2$s(s) terms updated with success !', 'simpletags' ), (int) $counter, strtolower( SimpleTags_Admin::$post_type_name ) ), 'updated' );
return true;
}
}
return false;
}
/**
* WP Page - Mass edit tags
*
*/
public static function pageMassEditTags() {
global $wpdb, $wp_locale, $wp_query;
list( $post_stati, $avail_post_stati ) = self::edit_data_query();
if ( ! isset( $_GET['paged'] ) ) {
$_GET['paged'] = 1;
}
// Display message
settings_errors( __CLASS__ );
?>
plugin\'s homepage for further details. If you find a bug, or have a fantastic idea for this plugin, ask me !', 'simpletags' ); ?>
array(
_x( 'Published', 'post' ),
__( 'Published posts' ),
_n_noop( 'Published (%s)', 'Published (%s)' )
),
'future' => array(
_x( 'Scheduled', 'post' ),
__( 'Scheduled posts' ),
_n_noop( 'Scheduled (%s)', 'Scheduled (%s)' )
),
'pending' => array(
_x( 'Pending Review', 'post' ),
__( 'Pending posts' ),
_n_noop( 'Pending Review (%s)', 'Pending Review (%s)' )
),
'draft' => array(
_x( 'Draft', 'post' ),
_x( 'Drafts', 'manage posts header' ),
_n_noop( 'Draft (%s)', 'Drafts (%s)' )
),
'private' => array(
_x( 'Private', 'post' ),
__( 'Private posts' ),
_n_noop( 'Private (%s)', 'Private (%s)' )
),
);
$post_stati = apply_filters( 'post_stati', $post_stati );
$avail_post_stati = get_available_post_statuses( SimpleTags_Admin::$post_type );
$post_status_q = '';
if ( isset( $q['post_status'] ) && in_array( $q['post_status'], array_keys( $post_stati ) ) ) {
$post_status_q = '&post_status=' . $q['post_status'];
$post_status_q .= '&perm=readable';
} elseif ( ! isset( $q['post_status'] ) ) {
$q['post_status'] = '';
}
if ( 'pending' === $q['post_status'] ) {
$order = 'ASC';
$orderby = 'modified';
} elseif ( 'draft' === $q['post_status'] ) {
$order = 'DESC';
$orderby = 'modified';
} else {
$order = 'DESC';
$orderby = 'date';
}
wp( "post_type={$q['post_type']}&what_to_show=posts$post_status_q&posts_per_page={$q['posts_per_page']}&order=$order&orderby=$orderby" );
return array( $post_stati, $avail_post_stati );
}
}