Skip to content

Commit

Permalink
update admin column receiver / emitter
Browse files Browse the repository at this point in the history
  • Loading branch information
asadowski10 committed Sep 27, 2017
1 parent 787b842 commit c10651e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Compatible up to WordPress 4.6.

## Changelog

### 3.0.4 - 27 Sept 2017
* Fix display admin emitters / receivers column

### 3.0.3 - 27 Sept 2017
* Fix infinite loop insertion for taxonomies

Expand Down
4 changes: 2 additions & 2 deletions bea-content-sync-fusion.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: BEA - Content Synchronization - Fusion
Plugin URI: http://www.beapi.fr
Description: Manage content synchronization across a WordPress multisite
Version: 3.0.3
Version: 3.0.4
Author: BeAPI
Author URI: http://www.beapi.fr
Network: true
Expand All @@ -18,7 +18,7 @@
*/

// Plugin constants
define( 'BEA_CSF_VERSION', '3.0.3' );
define( 'BEA_CSF_VERSION', '3.0.4' );
define( 'BEA_CSF_OPTION', 'bea-content-sync-fusion' );
define( 'BEA_CSF_LOCALE', 'bea-content-sync-fusion' );

Expand Down
32 changes: 18 additions & 14 deletions classes/admin/admin-synchronizations-network.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
class BEA_CSF_Admin_Synchronizations_Network {

private static $_default_fields = array(
'label' => '',
'post_type' => '',
'mode' => 'auto',
'status' => 'publish',
'emitters' => array(),
'receivers' => array()
'label' => '',
'post_type' => '',
'mode' => 'auto',
'status' => 'publish',
'emitters' => array(),
'receivers' => array()
);

/**
Expand Down Expand Up @@ -255,7 +255,11 @@ public static function admin_init() {
*/
public static function get_sites_from_network( $network_id = null ) {
$site_query_args = array(
'public' => 1,
'public' => 1,
'archived' => 0,
'mature' => 0,
'spam' => 0,
'deleted' => 0,
);
if ( is_null( $network_id ) ) {
$site_query_args['network__in'] = get_current_network_id();
Expand All @@ -270,8 +274,8 @@ public static function get_sites_from_network( $network_id = null ) {
*
* @author Maxime CULEA
*
* @var array $site_query_args : the query args
* @var int|null $network_id : the network id working on
* @var array $site_query_args : the query args
* @var int|null $network_id : the network id working on
*/
$site_query_args = apply_filters( 'bea_csf.admin.admin_synchronization_network.query_args', $site_query_args, $network_id );

Expand All @@ -288,7 +292,7 @@ public static function get_sites_from_network( $network_id = null ) {
'network_id' => $site->network_id,
'blog_id' => $site->blog_id,
'domain' => $site->domain,
'path' => $site->path
'path' => $site->path,
);

// Set the name : {network_name} {site_name}
Expand All @@ -303,7 +307,7 @@ public static function get_sites_from_network( $network_id = null ) {
}

// Sort by network id then blog_id
usort( $return_sites, function ( $a, $b ) {
uasort( $return_sites, function ( $a, $b ) {
if ( $a['network_id'] == $b ['network_id'] ) {
return ( $a['blog_id'] < $b ['blog_id'] ) ? - 1 : 1;
}
Expand All @@ -318,9 +322,9 @@ public static function get_sites_from_network( $network_id = null ) {
*
* @author Maxime CULEA
*
* @var array $return_sites : the formatted sites from \WP_Site_Query
* @var array $sites : the retrieved sites \WP_Site object from \WP_Site_Query
* @var int|null $network_id : the network id working on
* @var array $return_sites : the formatted sites from \WP_Site_Query
* @var array $sites : the retrieved sites \WP_Site object from \WP_Site_Query
* @var int|null $network_id : the network id working on
*/
return apply_filters( 'bea_csf.admin.admin_synchronization_network.sites', $return_sites, $sites, $network_id );
}
Expand Down

0 comments on commit c10651e

Please sign in to comment.