Version Description
Download this release
Release Info
Developer | patilvikasj |
Plugin | Lightweight Sidebar Manager |
Version | 1.1.0 |
Comparing to | |
See all releases |
Code changes from version 1.0.2 to 1.1.0
- classes/class-bsf-sb-post-type.php +131 -1
- classes/class-bsf-sb-white-label.php +8 -8
- classes/modules/target-rule/class-bsf-sb-target-rules-fields.php +69 -58
- includes/white-label.php +9 -3
- languages/sidebar-manager.pot +43 -38
- readme.txt +8 -4
- sidebar-manager.php +2 -2
classes/class-bsf-sb-post-type.php
CHANGED
@@ -46,6 +46,119 @@ if ( ! class_exists( 'BSF_SB_Post_Type' ) ) {
|
|
46 |
*/
|
47 |
private function load_actions() {
|
48 |
add_action( 'init', array( $this, 'register_post_type' ), 25 );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
}
|
50 |
|
51 |
/**
|
@@ -97,7 +210,7 @@ if ( ! class_exists( 'BSF_SB_Post_Type' ) ) {
|
|
97 |
'show_ui' => true,
|
98 |
'show_in_nav_menus' => false,
|
99 |
'show_in_admin_bar' => false,
|
100 |
-
'show_in_menu' =>
|
101 |
'query_var' => true,
|
102 |
'rewrite' => $rewrite,
|
103 |
'capability_type' => 'post',
|
@@ -108,6 +221,23 @@ if ( ! class_exists( 'BSF_SB_Post_Type' ) ) {
|
|
108 |
);
|
109 |
register_post_type( BSF_SB_POST_TYPE, $args );
|
110 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
}
|
112 |
}
|
113 |
|
46 |
*/
|
47 |
private function load_actions() {
|
48 |
add_action( 'init', array( $this, 'register_post_type' ), 25 );
|
49 |
+
add_action( 'admin_menu', array( $this, 'register_sidebar_manager_menu' ), 101 );
|
50 |
+
add_action( 'admin_head', array( $this, 'menu_highlight' ) );
|
51 |
+
|
52 |
+
if ( is_admin() ) {
|
53 |
+
add_action( 'manage_bsf-sidebar_posts_custom_column', array( $this, 'column_content' ), 10, 2 );
|
54 |
+
// Filters.
|
55 |
+
add_filter( 'manage_bsf-sidebar_posts_columns', array( $this, 'column_headings' ) );
|
56 |
+
}
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Adds or removes list table column headings.
|
61 |
+
*
|
62 |
+
* @param array $columns Array of columns.
|
63 |
+
* @return array
|
64 |
+
*/
|
65 |
+
static public function column_headings( $columns ) {
|
66 |
+
|
67 |
+
unset( $columns['date'] );
|
68 |
+
|
69 |
+
$columns['sidebar_display_rules'] = __( 'Display Rules', 'sidebar-manager' );
|
70 |
+
$columns['date'] = __( 'Date', 'sidebar-manager' );
|
71 |
+
|
72 |
+
return $columns;
|
73 |
+
}
|
74 |
+
|
75 |
+
/**
|
76 |
+
* Adds the custom list table column content.
|
77 |
+
*
|
78 |
+
* @since 1.0
|
79 |
+
* @param array $column Name of column.
|
80 |
+
* @param int $post_id Post id.
|
81 |
+
* @return void
|
82 |
+
*/
|
83 |
+
public function column_content( $column, $post_id ) {
|
84 |
+
|
85 |
+
if ( 'sidebar_display_rules' == $column ) {
|
86 |
+
|
87 |
+
$locations = get_post_meta( $post_id, '_bsf-sb-location', true );
|
88 |
+
if ( ! empty( $locations ) ) {
|
89 |
+
echo '<div class="ast-advanced-headers-location-wrap" style="margin-bottom: 5px;">';
|
90 |
+
echo '<strong>Display: </strong>';
|
91 |
+
$this->column_display_location_rules( $locations );
|
92 |
+
echo '</div>';
|
93 |
+
}
|
94 |
+
|
95 |
+
$locations = get_post_meta( $post_id, '_bsf-sb-exclusion', true );
|
96 |
+
if ( ! empty( $locations ) ) {
|
97 |
+
echo '<div class="ast-advanced-headers-exclusion-wrap" style="margin-bottom: 5px;">';
|
98 |
+
echo '<strong>Exclusion: </strong>';
|
99 |
+
$this->column_display_location_rules( $locations );
|
100 |
+
echo '</div>';
|
101 |
+
}
|
102 |
+
|
103 |
+
$users = get_post_meta( $post_id, '_bsf-sb-users', true );
|
104 |
+
if ( isset( $users ) && is_array( $users ) ) {
|
105 |
+
if ( isset( $users[0] ) && ! empty( $users[0] ) ) {
|
106 |
+
$user_label = array();
|
107 |
+
|
108 |
+
foreach ( $users as $user ) {
|
109 |
+
$user_label[] = Astra_Target_Rules_Fields::get_user_by_key( $user );
|
110 |
+
}
|
111 |
+
|
112 |
+
echo '<div class="ast-advanced-headers-users-wrap">';
|
113 |
+
echo '<strong>Users: </strong>';
|
114 |
+
echo join( ', ', $user_label );
|
115 |
+
echo '</div>';
|
116 |
+
}
|
117 |
+
}
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Get Markup of Location rules for Display rule column.
|
123 |
+
*
|
124 |
+
* @param array $locations Array of locations.
|
125 |
+
* @return void
|
126 |
+
*/
|
127 |
+
public function column_display_location_rules( $locations ) {
|
128 |
+
|
129 |
+
$location_label = array();
|
130 |
+
$index = array_search( 'specifics', $locations['rule'] );
|
131 |
+
if ( false !== $index && ! empty( $index ) ) {
|
132 |
+
unset( $locations['rule'][ $index ] );
|
133 |
+
}
|
134 |
+
|
135 |
+
if ( isset( $locations['rule'] ) && is_array( $locations['rule'] ) ) {
|
136 |
+
foreach ( $locations['rule'] as $location ) {
|
137 |
+
$location_label[] = Astra_Target_Rules_Fields::get_location_by_key( $location );
|
138 |
+
}
|
139 |
+
}
|
140 |
+
if ( isset( $locations['specific'] ) && is_array( $locations['specific'] ) ) {
|
141 |
+
foreach ( $locations['specific'] as $location ) {
|
142 |
+
$location_label[] = Astra_Target_Rules_Fields::get_location_by_key( $location );
|
143 |
+
}
|
144 |
+
}
|
145 |
+
|
146 |
+
echo join( ', ', $location_label );
|
147 |
+
|
148 |
+
}
|
149 |
+
|
150 |
+
/**
|
151 |
+
* Highlight themes.php and sidebars menu when editing sidebars.
|
152 |
+
*
|
153 |
+
* @since x.x.x
|
154 |
+
* @return void
|
155 |
+
*/
|
156 |
+
public function menu_highlight() {
|
157 |
+
global $parent_file, $submenu_file, $post_type;
|
158 |
+
if ( BSF_SB_POST_TYPE == $post_type ) {
|
159 |
+
$parent_file = 'themes.php';
|
160 |
+
$submenu_file = 'edit.php?post_type=' . BSF_SB_POST_TYPE;
|
161 |
+
}
|
162 |
}
|
163 |
|
164 |
/**
|
210 |
'show_ui' => true,
|
211 |
'show_in_nav_menus' => false,
|
212 |
'show_in_admin_bar' => false,
|
213 |
+
'show_in_menu' => false,
|
214 |
'query_var' => true,
|
215 |
'rewrite' => $rewrite,
|
216 |
'capability_type' => 'post',
|
221 |
);
|
222 |
register_post_type( BSF_SB_POST_TYPE, $args );
|
223 |
}
|
224 |
+
|
225 |
+
/**
|
226 |
+
* Register custom font menu
|
227 |
+
*
|
228 |
+
* @since 1.0.0
|
229 |
+
*/
|
230 |
+
public function register_sidebar_manager_menu() {
|
231 |
+
|
232 |
+
$title = apply_filters( 'bsf_sidebar_manager_menu_title', __( 'Sidebars', 'sidebar-manager' ) );
|
233 |
+
add_submenu_page(
|
234 |
+
'themes.php',
|
235 |
+
$title,
|
236 |
+
$title,
|
237 |
+
'edit_pages',
|
238 |
+
'edit.php?post_type=' . BSF_SB_POST_TYPE
|
239 |
+
);
|
240 |
+
}
|
241 |
}
|
242 |
}
|
243 |
|
classes/class-bsf-sb-white-label.php
CHANGED
@@ -71,7 +71,7 @@ if ( ! class_exists( 'Bsf_Sb_White_Label' ) ) :
|
|
71 |
*/
|
72 |
function plugins_page( $plugins ) {
|
73 |
|
74 |
-
if ( ! is_callable( 'Astra_Ext_White_Label_Markup::
|
75 |
return $plugins;
|
76 |
}
|
77 |
|
@@ -80,10 +80,10 @@ if ( ! class_exists( 'Bsf_Sb_White_Label' ) ) :
|
|
80 |
}
|
81 |
|
82 |
// Set White Labels.
|
83 |
-
$name = Astra_Ext_White_Label_Markup::
|
84 |
-
$description = Astra_Ext_White_Label_Markup::
|
85 |
-
$author = Astra_Ext_White_Label_Markup::
|
86 |
-
$author_uri = Astra_Ext_White_Label_Markup::
|
87 |
|
88 |
if ( ! empty( $name ) ) {
|
89 |
$plugins[ BSF_SB_BASE ]['Name'] = $name;
|
@@ -119,11 +119,11 @@ if ( ! class_exists( 'Bsf_Sb_White_Label' ) ) :
|
|
119 |
*/
|
120 |
public function plugin_links( $plugin_meta, $plugin_file, $plugin_data ) {
|
121 |
|
122 |
-
if ( is_callable( 'Astra_Ext_White_Label_Markup::
|
123 |
if ( BSF_SB_BASE == $plugin_file ) {
|
124 |
// Set White Labels.
|
125 |
-
$name = Astra_Ext_White_Label_Markup::
|
126 |
-
$description = Astra_Ext_White_Label_Markup::
|
127 |
|
128 |
if ( ! empty( $name ) ) {
|
129 |
// Remove Plugin URI if Agency White Label name is set.
|
71 |
*/
|
72 |
function plugins_page( $plugins ) {
|
73 |
|
74 |
+
if ( ! is_callable( 'Astra_Ext_White_Label_Markup::get_whitelabel_string' ) ) {
|
75 |
return $plugins;
|
76 |
}
|
77 |
|
80 |
}
|
81 |
|
82 |
// Set White Labels.
|
83 |
+
$name = Astra_Ext_White_Label_Markup::get_whitelabel_string( 'bsf-lw-sb', 'name' );
|
84 |
+
$description = Astra_Ext_White_Label_Markup::get_whitelabel_string( 'bsf-lw-sb', 'description' );
|
85 |
+
$author = Astra_Ext_White_Label_Markup::get_whitelabel_string( 'astra-agency', 'author' );
|
86 |
+
$author_uri = Astra_Ext_White_Label_Markup::get_whitelabel_string( 'astra-agency', 'author_url' );
|
87 |
|
88 |
if ( ! empty( $name ) ) {
|
89 |
$plugins[ BSF_SB_BASE ]['Name'] = $name;
|
119 |
*/
|
120 |
public function plugin_links( $plugin_meta, $plugin_file, $plugin_data ) {
|
121 |
|
122 |
+
if ( is_callable( 'Astra_Ext_White_Label_Markup::get_whitelabel_string' ) ) {
|
123 |
if ( BSF_SB_BASE == $plugin_file ) {
|
124 |
// Set White Labels.
|
125 |
+
$name = Astra_Ext_White_Label_Markup::get_whitelabel_string( 'bsf-lw-sb', 'name' );
|
126 |
+
$description = Astra_Ext_White_Label_Markup::get_whitelabel_string( 'bsf-lw-sb', 'description' );
|
127 |
|
128 |
if ( ! empty( $name ) ) {
|
129 |
// Remove Plugin URI if Agency White Label name is set.
|
classes/modules/target-rule/class-bsf-sb-target-rules-fields.php
CHANGED
@@ -100,7 +100,7 @@ if ( ! class_exists( 'BSF_SB_Target_Rules_Fields' ) ) {
|
|
100 |
* @return void
|
101 |
*/
|
102 |
public function initialize_options() {
|
103 |
-
self::$user_selection
|
104 |
self::$location_selection = self::get_location_selections();
|
105 |
}
|
106 |
|
@@ -135,7 +135,7 @@ if ( ! class_exists( 'BSF_SB_Target_Rules_Fields' ) ) {
|
|
135 |
unset( $post_types['attachment'] );
|
136 |
|
137 |
$args['_builtin'] = false;
|
138 |
-
$custom_post_type
|
139 |
|
140 |
$post_types = apply_filters( 'astra_location_rule_post_types', array_merge( $post_types, $custom_post_type ) );
|
141 |
|
@@ -153,7 +153,7 @@ if ( ! class_exists( 'BSF_SB_Target_Rules_Fields' ) ) {
|
|
153 |
}
|
154 |
|
155 |
$selection_options = array(
|
156 |
-
'basic'
|
157 |
'label' => __( 'Basic', 'sidebar-manager' ),
|
158 |
'value' => array(
|
159 |
'basic-global' => __( 'Entire Website', 'sidebar-manager' ),
|
@@ -230,12 +230,12 @@ if ( ! class_exists( 'BSF_SB_Target_Rules_Fields' ) ) {
|
|
230 |
*/
|
231 |
public static function get_user_selections() {
|
232 |
$selection_options = array(
|
233 |
-
'basic'
|
234 |
'label' => __( 'Basic', 'sidebar-manager' ),
|
235 |
'value' => array(
|
236 |
-
'all'
|
237 |
-
'logged-in'
|
238 |
-
'logged-out'
|
239 |
),
|
240 |
),
|
241 |
|
@@ -274,14 +274,14 @@ if ( ! class_exists( 'BSF_SB_Target_Rules_Fields' ) ) {
|
|
274 |
}
|
275 |
|
276 |
if ( strpos( $key, 'post-' ) !== false ) {
|
277 |
-
$post_id
|
278 |
return get_the_title( $post_id );
|
279 |
}
|
280 |
|
281 |
// taxonomy options.
|
282 |
if ( strpos( $key, 'tax-' ) !== false ) {
|
283 |
-
$tax_id
|
284 |
-
$term
|
285 |
|
286 |
if ( ! is_wp_error( $term ) ) {
|
287 |
$term_taxonomy = ucfirst( str_replace( '_', ' ', $term->taxonomy ) );
|
@@ -355,7 +355,7 @@ if ( ! class_exists( 'BSF_SB_Target_Rules_Fields' ) ) {
|
|
355 |
if ( $query->have_posts() ) {
|
356 |
while ( $query->have_posts() ) {
|
357 |
$query->the_post();
|
358 |
-
$title
|
359 |
$title .= ( 0 != $query->post->post_parent ) ? ' (' . get_the_title( $query->post->post_parent ) . ')' : '';
|
360 |
$id = get_the_id();
|
361 |
$data[] = array(
|
@@ -387,7 +387,8 @@ if ( ! class_exists( 'BSF_SB_Target_Rules_Fields' ) ) {
|
|
387 |
|
388 |
foreach ( $taxonomies as $taxonomy ) {
|
389 |
$terms = get_terms(
|
390 |
-
$taxonomy->name,
|
|
|
391 |
'orderby' => 'count',
|
392 |
'hide_empty' => 0,
|
393 |
'name__like' => $search_string,
|
@@ -473,16 +474,24 @@ if ( ! class_exists( 'BSF_SB_Target_Rules_Fields' ) ) {
|
|
473 |
|
474 |
wp_enqueue_script( 'bsf-sb-select2', BSF_SB_URL . 'classes/modules/target-rule/select2.js', array( 'jquery' ), BSF_SB_VER, true );
|
475 |
wp_enqueue_script(
|
476 |
-
'bsf-sb-target-rule',
|
|
|
|
|
477 |
'jquery',
|
478 |
'wp-util',
|
479 |
'bsf-sb-select2',
|
480 |
-
),
|
|
|
|
|
481 |
);
|
482 |
wp_enqueue_script(
|
483 |
-
'bsf-sb-user-role',
|
|
|
|
|
484 |
'jquery',
|
485 |
-
),
|
|
|
|
|
486 |
);
|
487 |
wp_enqueue_style( 'bsf-sb-select2', BSF_SB_URL . 'classes/modules/target-rule/select2.css', '', BSF_SB_VER );
|
488 |
wp_enqueue_style( 'bsf-sb-target-rule', BSF_SB_URL . 'classes/modules/target-rule/target-rule.css', '', BSF_SB_VER );
|
@@ -562,7 +571,7 @@ if ( ! class_exists( 'BSF_SB_Target_Rules_Fields' ) ) {
|
|
562 |
* @since 1.0.0
|
563 |
*
|
564 |
* @param object $post_type post type parameter.
|
565 |
-
* @param object $
|
566 |
*/
|
567 |
public static function get_post_target_rule_options( $post_type, $taxonomy ) {
|
568 |
|
@@ -660,7 +669,7 @@ if ( ! class_exists( 'BSF_SB_Target_Rules_Fields' ) ) {
|
|
660 |
if ( strpos( $sel_value, 'post-' ) !== false ) {
|
661 |
$post_id = (int) str_replace( 'post-', '', $sel_value );
|
662 |
$post_title = get_the_title( $post_id );
|
663 |
-
$output
|
664 |
}
|
665 |
|
666 |
// taxonomy options.
|
@@ -668,7 +677,7 @@ if ( ! class_exists( 'BSF_SB_Target_Rules_Fields' ) ) {
|
|
668 |
$tax_id = (int) str_replace( 'tax-', '', $sel_value );
|
669 |
$term = get_term( $tax_id );
|
670 |
$term_taxonomy = ucfirst( str_replace( '_', ' ', $term->taxonomy ) );
|
671 |
-
$output
|
672 |
|
673 |
}
|
674 |
}
|
@@ -740,7 +749,7 @@ if ( ! class_exists( 'BSF_SB_Target_Rules_Fields' ) ) {
|
|
740 |
*/
|
741 |
public function parse_layout_display_condition( $post_id, $rules ) {
|
742 |
|
743 |
-
$display
|
744 |
$current_post_type = get_post_type( $post_id );
|
745 |
|
746 |
if ( isset( $rules['rule'] ) && is_array( $rules['rule'] ) && ! empty( $rules['rule'] ) ) {
|
@@ -923,11 +932,11 @@ if ( ! class_exists( 'BSF_SB_Target_Rules_Fields' ) ) {
|
|
923 |
$selection_options = self::$user_selection;
|
924 |
|
925 |
/* WP Template Format */
|
926 |
-
$output
|
927 |
-
$output
|
928 |
$output .= '<span class="user_role-condition-delete dashicons dashicons-dismiss"></span>';
|
929 |
/* Condition Selection */
|
930 |
-
$output
|
931 |
$output .= '<select name="' . esc_attr( $input_name ) . '[{{data.id}}]" class="user_role-condition form-control bsf-sb-input">';
|
932 |
$output .= '<option value="">' . __( 'Select', 'sidebar-manager' ) . '</option>';
|
933 |
|
@@ -940,26 +949,26 @@ if ( ! class_exists( 'BSF_SB_Target_Rules_Fields' ) ) {
|
|
940 |
$output .= '</optgroup>';
|
941 |
}
|
942 |
$output .= '</select>';
|
943 |
-
$output
|
944 |
-
$output
|
945 |
-
$output
|
946 |
|
947 |
if ( ! is_array( $saved_values ) || ( is_array( $saved_values ) && empty( $saved_values ) ) ) {
|
948 |
|
949 |
-
$saved_values
|
950 |
-
$saved_values[0]
|
951 |
}
|
952 |
|
953 |
$index = 0;
|
954 |
|
955 |
-
$output
|
956 |
-
$output
|
957 |
$output .= '<div class="user_role-builder-wrap">';
|
958 |
foreach ( $saved_values as $index => $data ) {
|
959 |
-
$output
|
960 |
$output .= '<span class="user_role-condition-delete dashicons dashicons-dismiss"></span>';
|
961 |
/* Condition Selection */
|
962 |
-
$output
|
963 |
$output .= '<select name="' . esc_attr( $input_name ) . '[' . $index . ']" class="user_role-condition form-control bsf-sb-input">';
|
964 |
$output .= '<option value="">' . __( 'Select', 'sidebar-manager' ) . '</option>';
|
965 |
|
@@ -973,7 +982,7 @@ if ( ! class_exists( 'BSF_SB_Target_Rules_Fields' ) ) {
|
|
973 |
$output .= '</optgroup>';
|
974 |
}
|
975 |
$output .= '</select>';
|
976 |
-
$output
|
977 |
$output .= '</div> <!-- bsf-sb-user-role-condition -->';
|
978 |
}
|
979 |
$output .= '</div>';
|
@@ -981,8 +990,8 @@ if ( ! class_exists( 'BSF_SB_Target_Rules_Fields' ) ) {
|
|
981 |
$output .= '<div class="user_role-add-rule-wrap">';
|
982 |
$output .= '<a href="#" class="button" data-rule-id="' . absint( $index ) . '">' . $add_rule_label . '</a>';
|
983 |
$output .= '</div>';
|
984 |
-
$output
|
985 |
-
$output
|
986 |
|
987 |
echo $output;
|
988 |
}
|
@@ -1008,7 +1017,7 @@ if ( ! class_exists( 'BSF_SB_Target_Rules_Fields' ) ) {
|
|
1008 |
switch ( $rule ) {
|
1009 |
case '':
|
1010 |
case 'all':
|
1011 |
-
$show_popup
|
1012 |
break;
|
1013 |
|
1014 |
case 'logged-in':
|
@@ -1059,7 +1068,7 @@ if ( ! class_exists( 'BSF_SB_Target_Rules_Fields' ) ) {
|
|
1059 |
|
1060 |
if ( null === self::$current_page_type ) {
|
1061 |
|
1062 |
-
$page_type
|
1063 |
$current_id = false;
|
1064 |
|
1065 |
if ( is_404() ) {
|
@@ -1081,10 +1090,10 @@ if ( ! class_exists( 'BSF_SB_Target_Rules_Fields' ) ) {
|
|
1081 |
} elseif ( is_home() ) {
|
1082 |
$page_type = 'is_home';
|
1083 |
} elseif ( is_front_page() ) {
|
1084 |
-
$page_type
|
1085 |
$current_id = get_the_id();
|
1086 |
} elseif ( is_singular() ) {
|
1087 |
-
$page_type
|
1088 |
$current_id = get_the_id();
|
1089 |
} else {
|
1090 |
$current_id = get_the_id();
|
@@ -1210,9 +1219,9 @@ if ( ! class_exists( 'BSF_SB_Target_Rules_Fields' ) ) {
|
|
1210 |
|
1211 |
foreach ( $posts as $local_post ) {
|
1212 |
self::$current_page_data[ $post_type ][ $local_post->ID ] = array(
|
1213 |
-
'id'
|
1214 |
-
'post_name'
|
1215 |
-
'location'
|
1216 |
);
|
1217 |
}
|
1218 |
|
@@ -1234,13 +1243,13 @@ if ( ! class_exists( 'BSF_SB_Target_Rules_Fields' ) ) {
|
|
1234 |
*/
|
1235 |
public function remove_exclusion_rule_posts( $post_type, $option ) {
|
1236 |
|
1237 |
-
$exclusion
|
1238 |
-
$current_post_id
|
1239 |
|
1240 |
foreach ( self::$current_page_data[ $post_type ] as $c_post_id => $c_data ) {
|
1241 |
|
1242 |
-
$exclusion_rules
|
1243 |
-
$is_exclude
|
1244 |
|
1245 |
if ( $is_exclude ) {
|
1246 |
unset( self::$current_page_data[ $post_type ][ $c_post_id ] );
|
@@ -1257,8 +1266,8 @@ if ( ! class_exists( 'BSF_SB_Target_Rules_Fields' ) ) {
|
|
1257 |
*/
|
1258 |
public function remove_user_rule_posts( $post_type, $option ) {
|
1259 |
|
1260 |
-
$users
|
1261 |
-
$current_post_id
|
1262 |
|
1263 |
foreach ( self::$current_page_data[ $post_type ] as $c_post_id => $c_data ) {
|
1264 |
|
@@ -1282,8 +1291,8 @@ if ( ! class_exists( 'BSF_SB_Target_Rules_Fields' ) ) {
|
|
1282 |
global $wpdb;
|
1283 |
global $post;
|
1284 |
|
1285 |
-
$all_rules
|
1286 |
-
$already_set_rule
|
1287 |
|
1288 |
$location = isset( $option['location'] ) ? $option['location'] : '';
|
1289 |
|
@@ -1291,9 +1300,10 @@ if ( ! class_exists( 'BSF_SB_Target_Rules_Fields' ) ) {
|
|
1291 |
$wpdb->prepare(
|
1292 |
"SELECT p.ID, p.post_title, pm.meta_value FROM {$wpdb->postmeta} as pm
|
1293 |
INNER JOIN {$wpdb->posts} as p ON pm.post_id = p.ID
|
1294 |
-
WHERE pm.meta_key =
|
1295 |
-
AND p.post_type =
|
1296 |
-
AND p.post_status = 'publish'",
|
|
|
1297 |
$post_type
|
1298 |
)
|
1299 |
);
|
@@ -1315,14 +1325,14 @@ if ( ! class_exists( 'BSF_SB_Target_Rules_Fields' ) ) {
|
|
1315 |
foreach ( $location_rules['specific'] as $s_index => $s_value ) {
|
1316 |
|
1317 |
$all_rules[ $rule ][ $s_value ][ $header->ID ] = array(
|
1318 |
-
'ID'
|
1319 |
-
'name'
|
1320 |
);
|
1321 |
}
|
1322 |
} else {
|
1323 |
$all_rules[ $rule ][ $header->ID ] = array(
|
1324 |
-
'ID'
|
1325 |
-
'name'
|
1326 |
);
|
1327 |
}
|
1328 |
}
|
@@ -1371,7 +1381,8 @@ if ( ! class_exists( 'BSF_SB_Target_Rules_Fields' ) ) {
|
|
1371 |
|
1372 |
if ( ! empty( $already_set_rule ) ) {
|
1373 |
add_action(
|
1374 |
-
'admin_notices',
|
|
|
1375 |
|
1376 |
$rule_set_titles = '<strong>' . implode( ',', $already_set_rule ) . '</strong>';
|
1377 |
|
100 |
* @return void
|
101 |
*/
|
102 |
public function initialize_options() {
|
103 |
+
self::$user_selection = self::get_user_selections();
|
104 |
self::$location_selection = self::get_location_selections();
|
105 |
}
|
106 |
|
135 |
unset( $post_types['attachment'] );
|
136 |
|
137 |
$args['_builtin'] = false;
|
138 |
+
$custom_post_type = get_post_types( $args, 'objects' );
|
139 |
|
140 |
$post_types = apply_filters( 'astra_location_rule_post_types', array_merge( $post_types, $custom_post_type ) );
|
141 |
|
153 |
}
|
154 |
|
155 |
$selection_options = array(
|
156 |
+
'basic' => array(
|
157 |
'label' => __( 'Basic', 'sidebar-manager' ),
|
158 |
'value' => array(
|
159 |
'basic-global' => __( 'Entire Website', 'sidebar-manager' ),
|
230 |
*/
|
231 |
public static function get_user_selections() {
|
232 |
$selection_options = array(
|
233 |
+
'basic' => array(
|
234 |
'label' => __( 'Basic', 'sidebar-manager' ),
|
235 |
'value' => array(
|
236 |
+
'all' => __( 'All', 'sidebar-manager' ),
|
237 |
+
'logged-in' => __( 'Logged In', 'sidebar-manager' ),
|
238 |
+
'logged-out' => __( 'Logged Out', 'sidebar-manager' ),
|
239 |
),
|
240 |
),
|
241 |
|
274 |
}
|
275 |
|
276 |
if ( strpos( $key, 'post-' ) !== false ) {
|
277 |
+
$post_id = (int) str_replace( 'post-', '', $key );
|
278 |
return get_the_title( $post_id );
|
279 |
}
|
280 |
|
281 |
// taxonomy options.
|
282 |
if ( strpos( $key, 'tax-' ) !== false ) {
|
283 |
+
$tax_id = (int) str_replace( 'tax-', '', $key );
|
284 |
+
$term = get_term( $tax_id );
|
285 |
|
286 |
if ( ! is_wp_error( $term ) ) {
|
287 |
$term_taxonomy = ucfirst( str_replace( '_', ' ', $term->taxonomy ) );
|
355 |
if ( $query->have_posts() ) {
|
356 |
while ( $query->have_posts() ) {
|
357 |
$query->the_post();
|
358 |
+
$title = get_the_title();
|
359 |
$title .= ( 0 != $query->post->post_parent ) ? ' (' . get_the_title( $query->post->post_parent ) . ')' : '';
|
360 |
$id = get_the_id();
|
361 |
$data[] = array(
|
387 |
|
388 |
foreach ( $taxonomies as $taxonomy ) {
|
389 |
$terms = get_terms(
|
390 |
+
$taxonomy->name,
|
391 |
+
array(
|
392 |
'orderby' => 'count',
|
393 |
'hide_empty' => 0,
|
394 |
'name__like' => $search_string,
|
474 |
|
475 |
wp_enqueue_script( 'bsf-sb-select2', BSF_SB_URL . 'classes/modules/target-rule/select2.js', array( 'jquery' ), BSF_SB_VER, true );
|
476 |
wp_enqueue_script(
|
477 |
+
'bsf-sb-target-rule',
|
478 |
+
BSF_SB_URL . 'classes/modules/target-rule/target-rule.js',
|
479 |
+
array(
|
480 |
'jquery',
|
481 |
'wp-util',
|
482 |
'bsf-sb-select2',
|
483 |
+
),
|
484 |
+
BSF_SB_VER,
|
485 |
+
true
|
486 |
);
|
487 |
wp_enqueue_script(
|
488 |
+
'bsf-sb-user-role',
|
489 |
+
BSF_SB_URL . 'classes/modules/target-rule/user-role.js',
|
490 |
+
array(
|
491 |
'jquery',
|
492 |
+
),
|
493 |
+
BSF_SB_VER,
|
494 |
+
true
|
495 |
);
|
496 |
wp_enqueue_style( 'bsf-sb-select2', BSF_SB_URL . 'classes/modules/target-rule/select2.css', '', BSF_SB_VER );
|
497 |
wp_enqueue_style( 'bsf-sb-target-rule', BSF_SB_URL . 'classes/modules/target-rule/target-rule.css', '', BSF_SB_VER );
|
571 |
* @since 1.0.0
|
572 |
*
|
573 |
* @param object $post_type post type parameter.
|
574 |
+
* @param object $taxonomy Taxanomies for creating the target rule markup.
|
575 |
*/
|
576 |
public static function get_post_target_rule_options( $post_type, $taxonomy ) {
|
577 |
|
669 |
if ( strpos( $sel_value, 'post-' ) !== false ) {
|
670 |
$post_id = (int) str_replace( 'post-', '', $sel_value );
|
671 |
$post_title = get_the_title( $post_id );
|
672 |
+
$output .= '<option value="post-' . $post_id . '" selected="selected" >' . $post_title . '</option>';
|
673 |
}
|
674 |
|
675 |
// taxonomy options.
|
677 |
$tax_id = (int) str_replace( 'tax-', '', $sel_value );
|
678 |
$term = get_term( $tax_id );
|
679 |
$term_taxonomy = ucfirst( str_replace( '_', ' ', $term->taxonomy ) );
|
680 |
+
$output .= '<option value="tax-' . $tax_id . '" selected="selected" >' . $term->name . ' - ' . $term_taxonomy . '</option>';
|
681 |
|
682 |
}
|
683 |
}
|
749 |
*/
|
750 |
public function parse_layout_display_condition( $post_id, $rules ) {
|
751 |
|
752 |
+
$display = false;
|
753 |
$current_post_type = get_post_type( $post_id );
|
754 |
|
755 |
if ( isset( $rules['rule'] ) && is_array( $rules['rule'] ) && ! empty( $rules['rule'] ) ) {
|
932 |
$selection_options = self::$user_selection;
|
933 |
|
934 |
/* WP Template Format */
|
935 |
+
$output .= '<script type="text/html" id="tmpl-bsf-sb-user-role-condition">';
|
936 |
+
$output .= '<div class="bsf-sb-user-role-condition bsf-sb-user-role-{{data.id}}" data-rule="{{data.id}}" >';
|
937 |
$output .= '<span class="user_role-condition-delete dashicons dashicons-dismiss"></span>';
|
938 |
/* Condition Selection */
|
939 |
+
$output .= '<div class="user_role-condition-wrap" >';
|
940 |
$output .= '<select name="' . esc_attr( $input_name ) . '[{{data.id}}]" class="user_role-condition form-control bsf-sb-input">';
|
941 |
$output .= '<option value="">' . __( 'Select', 'sidebar-manager' ) . '</option>';
|
942 |
|
949 |
$output .= '</optgroup>';
|
950 |
}
|
951 |
$output .= '</select>';
|
952 |
+
$output .= '</div>';
|
953 |
+
$output .= '</div> <!-- bsf-sb-user-role-condition -->';
|
954 |
+
$output .= '</script>';
|
955 |
|
956 |
if ( ! is_array( $saved_values ) || ( is_array( $saved_values ) && empty( $saved_values ) ) ) {
|
957 |
|
958 |
+
$saved_values = array();
|
959 |
+
$saved_values[0] = '';
|
960 |
}
|
961 |
|
962 |
$index = 0;
|
963 |
|
964 |
+
$output .= '<div class="bsf-sb-user-role-wrapper bsf-sb-user-role-display-on-wrap" data-type="display">';
|
965 |
+
$output .= '<div class="bsf-sb-user-role-selector-wrapper bsf-sb-user-role-display-on">';
|
966 |
$output .= '<div class="user_role-builder-wrap">';
|
967 |
foreach ( $saved_values as $index => $data ) {
|
968 |
+
$output .= '<div class="bsf-sb-user-role-condition bsf-sb-user-role-' . $index . '" data-rule="' . $index . '" >';
|
969 |
$output .= '<span class="user_role-condition-delete dashicons dashicons-dismiss"></span>';
|
970 |
/* Condition Selection */
|
971 |
+
$output .= '<div class="user_role-condition-wrap" >';
|
972 |
$output .= '<select name="' . esc_attr( $input_name ) . '[' . $index . ']" class="user_role-condition form-control bsf-sb-input">';
|
973 |
$output .= '<option value="">' . __( 'Select', 'sidebar-manager' ) . '</option>';
|
974 |
|
982 |
$output .= '</optgroup>';
|
983 |
}
|
984 |
$output .= '</select>';
|
985 |
+
$output .= '</div>';
|
986 |
$output .= '</div> <!-- bsf-sb-user-role-condition -->';
|
987 |
}
|
988 |
$output .= '</div>';
|
990 |
$output .= '<div class="user_role-add-rule-wrap">';
|
991 |
$output .= '<a href="#" class="button" data-rule-id="' . absint( $index ) . '">' . $add_rule_label . '</a>';
|
992 |
$output .= '</div>';
|
993 |
+
$output .= '</div>';
|
994 |
+
$output .= '</div>';
|
995 |
|
996 |
echo $output;
|
997 |
}
|
1017 |
switch ( $rule ) {
|
1018 |
case '':
|
1019 |
case 'all':
|
1020 |
+
$show_popup = true;
|
1021 |
break;
|
1022 |
|
1023 |
case 'logged-in':
|
1068 |
|
1069 |
if ( null === self::$current_page_type ) {
|
1070 |
|
1071 |
+
$page_type = '';
|
1072 |
$current_id = false;
|
1073 |
|
1074 |
if ( is_404() ) {
|
1090 |
} elseif ( is_home() ) {
|
1091 |
$page_type = 'is_home';
|
1092 |
} elseif ( is_front_page() ) {
|
1093 |
+
$page_type = 'is_front_page';
|
1094 |
$current_id = get_the_id();
|
1095 |
} elseif ( is_singular() ) {
|
1096 |
+
$page_type = 'is_singular';
|
1097 |
$current_id = get_the_id();
|
1098 |
} else {
|
1099 |
$current_id = get_the_id();
|
1219 |
|
1220 |
foreach ( $posts as $local_post ) {
|
1221 |
self::$current_page_data[ $post_type ][ $local_post->ID ] = array(
|
1222 |
+
'id' => $local_post->ID,
|
1223 |
+
'post_name' => $local_post->post_name,
|
1224 |
+
'location' => unserialize( $local_post->meta_value ),
|
1225 |
);
|
1226 |
}
|
1227 |
|
1243 |
*/
|
1244 |
public function remove_exclusion_rule_posts( $post_type, $option ) {
|
1245 |
|
1246 |
+
$exclusion = isset( $option['exclusion'] ) ? $option['exclusion'] : '';
|
1247 |
+
$current_post_id = isset( $option['current_post_id'] ) ? $option['current_post_id'] : false;
|
1248 |
|
1249 |
foreach ( self::$current_page_data[ $post_type ] as $c_post_id => $c_data ) {
|
1250 |
|
1251 |
+
$exclusion_rules = get_post_meta( $c_post_id, $exclusion, true );
|
1252 |
+
$is_exclude = $this->parse_layout_display_condition( $current_post_id, $exclusion_rules );
|
1253 |
|
1254 |
if ( $is_exclude ) {
|
1255 |
unset( self::$current_page_data[ $post_type ][ $c_post_id ] );
|
1266 |
*/
|
1267 |
public function remove_user_rule_posts( $post_type, $option ) {
|
1268 |
|
1269 |
+
$users = isset( $option['users'] ) ? $option['users'] : '';
|
1270 |
+
$current_post_id = isset( $option['current_post_id'] ) ? $option['current_post_id'] : false;
|
1271 |
|
1272 |
foreach ( self::$current_page_data[ $post_type ] as $c_post_id => $c_data ) {
|
1273 |
|
1291 |
global $wpdb;
|
1292 |
global $post;
|
1293 |
|
1294 |
+
$all_rules = array();
|
1295 |
+
$already_set_rule = array();
|
1296 |
|
1297 |
$location = isset( $option['location'] ) ? $option['location'] : '';
|
1298 |
|
1300 |
$wpdb->prepare(
|
1301 |
"SELECT p.ID, p.post_title, pm.meta_value FROM {$wpdb->postmeta} as pm
|
1302 |
INNER JOIN {$wpdb->posts} as p ON pm.post_id = p.ID
|
1303 |
+
WHERE pm.meta_key = %s
|
1304 |
+
AND p.post_type = %s
|
1305 |
+
AND p.post_status = 'publish'",
|
1306 |
+
$location,
|
1307 |
$post_type
|
1308 |
)
|
1309 |
);
|
1325 |
foreach ( $location_rules['specific'] as $s_index => $s_value ) {
|
1326 |
|
1327 |
$all_rules[ $rule ][ $s_value ][ $header->ID ] = array(
|
1328 |
+
'ID' => $header->ID,
|
1329 |
+
'name' => $header->post_title,
|
1330 |
);
|
1331 |
}
|
1332 |
} else {
|
1333 |
$all_rules[ $rule ][ $header->ID ] = array(
|
1334 |
+
'ID' => $header->ID,
|
1335 |
+
'name' => $header->post_title,
|
1336 |
);
|
1337 |
}
|
1338 |
}
|
1381 |
|
1382 |
if ( ! empty( $already_set_rule ) ) {
|
1383 |
add_action(
|
1384 |
+
'admin_notices',
|
1385 |
+
function() use ( $already_set_rule ) {
|
1386 |
|
1387 |
$rule_set_titles = '<strong>' . implode( ',', $already_set_rule ) . '</strong>';
|
1388 |
|
includes/white-label.php
CHANGED
@@ -5,11 +5,17 @@
|
|
5 |
* @package Astra SideBar
|
6 |
*/
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
?>
|
9 |
<li>
|
10 |
<div class="branding-form postbox">
|
11 |
<button type="button" class="handlediv button-link" aria-expanded="true">
|
12 |
-
<span class="screen-reader-text"><?php _e( '
|
13 |
<span class="toggle-indicator" aria-hidden="true"></span>
|
14 |
</button>
|
15 |
<h2 class="hndle ui-sortable-handle">
|
@@ -19,12 +25,12 @@
|
|
19 |
<div class="form-wrap">
|
20 |
<div class="form-field">
|
21 |
<label><?php _e( 'Plugin Name:', 'sidebar-manager' ); ?>
|
22 |
-
<input type="text" name="ast_white_label[bsf-lw-sb][name]" class="placeholder placeholder-active" value="<?php echo esc_attr(
|
23 |
</label>
|
24 |
</div>
|
25 |
<div class="form-field">
|
26 |
<label><?php _e( 'Plugin Description:', 'sidebar-manager' ); ?>
|
27 |
-
<textarea name="ast_white_label[bsf-lw-sb][description]" class="placeholder placeholder-active" rows="2"><?php echo esc_attr(
|
28 |
</label>
|
29 |
</div>
|
30 |
<div class="clear"></div>
|
5 |
* @package Astra SideBar
|
6 |
*/
|
7 |
|
8 |
+
?>
|
9 |
+
<?php
|
10 |
+
// Bail from displaying settings screen if Astra Pro is older version.
|
11 |
+
if ( ! is_callable( 'Astra_Ext_White_Label_Markup::branding_key_to_constant' ) ) {
|
12 |
+
return;
|
13 |
+
}
|
14 |
?>
|
15 |
<li>
|
16 |
<div class="branding-form postbox">
|
17 |
<button type="button" class="handlediv button-link" aria-expanded="true">
|
18 |
+
<span class="screen-reader-text"><?php _e( 'Sidebar Manager', 'sidebar-manager' ); ?></span>
|
19 |
<span class="toggle-indicator" aria-hidden="true"></span>
|
20 |
</button>
|
21 |
<h2 class="hndle ui-sortable-handle">
|
25 |
<div class="form-wrap">
|
26 |
<div class="form-field">
|
27 |
<label><?php _e( 'Plugin Name:', 'sidebar-manager' ); ?>
|
28 |
+
<input type="text" name="ast_white_label[bsf-lw-sb][name]" class="placeholder placeholder-active" <?php disabled( defined( Astra_Ext_White_Label_Markup::branding_key_to_constant( 'bsf-lw-sb', 'name' ) ), true, true ); ?> value="<?php echo esc_attr( Astra_Ext_White_Label_Markup::get_whitelabel_string( 'bsf-lw-sb', 'name' ) ); ?>">
|
29 |
</label>
|
30 |
</div>
|
31 |
<div class="form-field">
|
32 |
<label><?php _e( 'Plugin Description:', 'sidebar-manager' ); ?>
|
33 |
+
<textarea name="ast_white_label[bsf-lw-sb][description]" class="placeholder placeholder-active" <?php disabled( defined( Astra_Ext_White_Label_Markup::branding_key_to_constant( 'bsf-lw-sb', 'description' ) ), true, true ); ?> rows="2"><?php echo esc_attr( Astra_Ext_White_Label_Markup::get_whitelabel_string( 'bsf-lw-sb', 'description' ) ); ?></textarea>
|
34 |
</label>
|
35 |
</div>
|
36 |
<div class="clear"></div>
|
languages/sidebar-manager.pot
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
-
# Copyright (C)
|
2 |
# This file is distributed under the same license as the Sidebar Manager package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Sidebar Manager 1.0
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/sidebar-manager\n"
|
7 |
-
"POT-Creation-Date:
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=utf-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
-
"PO-Revision-Date:
|
12 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
"Language: en\n"
|
@@ -22,7 +22,7 @@ msgstr ""
|
|
22 |
"X-Poedit-SearchPath-0: .\n"
|
23 |
"X-Poedit-Bookmarks: \n"
|
24 |
"X-Textdomain-Support: yes\n"
|
25 |
-
"X-Generator: grunt-wp-
|
26 |
|
27 |
#: classes/class-bsf-sb-metabox.php:57
|
28 |
msgid "Enter sidebar title here"
|
@@ -66,7 +66,7 @@ msgstr ""
|
|
66 |
msgid "Add locations for where this sidebar should appear."
|
67 |
msgstr ""
|
68 |
|
69 |
-
#: classes/class-bsf-sb-metabox.php:189
|
70 |
msgid "Display Rules"
|
71 |
msgstr ""
|
72 |
|
@@ -106,49 +106,54 @@ msgstr ""
|
|
106 |
msgid "Add User Rule"
|
107 |
msgstr ""
|
108 |
|
109 |
-
#: classes/class-bsf-sb-post-type.php:
|
|
|
|
|
|
|
|
|
110 |
msgid "Sidebar"
|
111 |
msgstr ""
|
112 |
|
113 |
-
#: classes/class-bsf-sb-post-type.php:
|
|
|
114 |
msgid "Sidebars"
|
115 |
msgstr ""
|
116 |
|
117 |
-
#: classes/class-bsf-sb-post-type.php:
|
118 |
msgid "Add New"
|
119 |
msgstr ""
|
120 |
|
121 |
-
#: classes/class-bsf-sb-post-type.php:
|
122 |
#. translators: %s singular
|
123 |
msgid "Add New %s"
|
124 |
msgstr ""
|
125 |
|
126 |
-
#: classes/class-bsf-sb-post-type.php:
|
127 |
#. translators: %s singular
|
128 |
msgid "Edit %s"
|
129 |
msgstr ""
|
130 |
|
131 |
-
#: classes/class-bsf-sb-post-type.php:
|
132 |
#. translators: %s singular
|
133 |
msgid "New %s"
|
134 |
msgstr ""
|
135 |
|
136 |
-
#: classes/class-bsf-sb-post-type.php:
|
137 |
#. translators: %s singular
|
138 |
msgid "View %s"
|
139 |
msgstr ""
|
140 |
|
141 |
-
#: classes/class-bsf-sb-post-type.php:
|
142 |
#. translators: %s plural
|
143 |
msgid "Search %s"
|
144 |
msgstr ""
|
145 |
|
146 |
-
#: classes/class-bsf-sb-post-type.php:
|
147 |
#. translators: %s plural
|
148 |
msgid "No %s Found"
|
149 |
msgstr ""
|
150 |
|
151 |
-
#: classes/class-bsf-sb-post-type.php:
|
152 |
#. translators: %s plural
|
153 |
msgid "No %s Found In Trash"
|
154 |
msgstr ""
|
@@ -226,56 +231,56 @@ msgstr ""
|
|
226 |
msgid "Advanced"
|
227 |
msgstr ""
|
228 |
|
229 |
-
#: classes/modules/target-rule/class-bsf-sb-target-rules-fields.php:
|
230 |
-
#: classes/modules/target-rule/class-bsf-sb-target-rules-fields.php:
|
231 |
msgid "Add Rule"
|
232 |
msgstr ""
|
233 |
|
234 |
-
#: classes/modules/target-rule/class-bsf-sb-target-rules-fields.php:
|
235 |
-
#: classes/modules/target-rule/class-bsf-sb-target-rules-fields.php:
|
236 |
-
#: classes/modules/target-rule/class-bsf-sb-target-rules-fields.php:
|
237 |
-
#: classes/modules/target-rule/class-bsf-sb-target-rules-fields.php:
|
238 |
-
#: classes/modules/target-rule/class-bsf-sb-target-rules-fields.php:
|
239 |
msgid "Select"
|
240 |
msgstr ""
|
241 |
|
242 |
-
#: classes/modules/target-rule/class-bsf-sb-target-rules-fields.php:
|
243 |
#. translators: %s post label
|
244 |
msgid "All %s"
|
245 |
msgstr ""
|
246 |
|
247 |
-
#: classes/modules/target-rule/class-bsf-sb-target-rules-fields.php:
|
248 |
-
#: classes/modules/target-rule/class-bsf-sb-target-rules-fields.php:
|
249 |
#. translators: %s post label
|
250 |
#. translators: %s taxonomy label
|
251 |
msgid "All %s Archive"
|
252 |
msgstr ""
|
253 |
|
254 |
-
#: classes/modules/target-rule/class-bsf-sb-target-rules-fields.php:
|
255 |
msgid "Add Exclusion Rule"
|
256 |
msgstr ""
|
257 |
|
258 |
-
#: classes/modules/target-rule/class-bsf-sb-target-rules-fields.php:
|
259 |
#. translators: %s post title.
|
260 |
msgid "The same display setting is already exist in %s post/s."
|
261 |
msgstr ""
|
262 |
|
263 |
-
|
|
|
|
|
|
|
|
|
264 |
msgid "Astra SideBar Branding"
|
265 |
msgstr ""
|
266 |
|
267 |
-
#: includes/white-label.php:
|
268 |
msgid "Plugin Name:"
|
269 |
msgstr ""
|
270 |
|
271 |
-
#: includes/white-label.php:
|
272 |
msgid "Plugin Description:"
|
273 |
msgstr ""
|
274 |
|
275 |
-
#. Plugin Name of the plugin/theme
|
276 |
-
msgid "Sidebar Manager"
|
277 |
-
msgstr ""
|
278 |
-
|
279 |
#. Plugin URI of the plugin/theme
|
280 |
msgid "http://www.brainstormforce.com"
|
281 |
msgstr ""
|
@@ -292,17 +297,17 @@ msgstr ""
|
|
292 |
msgid "https://www.brainstormforce.com/"
|
293 |
msgstr ""
|
294 |
|
295 |
-
#: classes/class-bsf-sb-post-type.php:
|
296 |
msgctxt "post type general name"
|
297 |
msgid "Sidebars"
|
298 |
msgstr ""
|
299 |
|
300 |
-
#: classes/class-bsf-sb-post-type.php:
|
301 |
msgctxt "post type singular name"
|
302 |
msgid "Sidebar"
|
303 |
msgstr ""
|
304 |
|
305 |
-
#: classes/class-bsf-sb-post-type.php:
|
306 |
msgctxt "admin menu"
|
307 |
msgid "Sidebars"
|
308 |
msgstr ""
|
1 |
+
# Copyright (C) 2019 Brainstorm Force
|
2 |
# This file is distributed under the same license as the Sidebar Manager package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Sidebar Manager 1.1.0\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/sidebar-manager\n"
|
7 |
+
"POT-Creation-Date: 2019-08-02 09:21:17+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=utf-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
11 |
+
"PO-Revision-Date: 2019-MO-DA HO:MI+ZONE\n"
|
12 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
"Language: en\n"
|
22 |
"X-Poedit-SearchPath-0: .\n"
|
23 |
"X-Poedit-Bookmarks: \n"
|
24 |
"X-Textdomain-Support: yes\n"
|
25 |
+
"X-Generator: grunt-wp-i18n 1.0.3\n"
|
26 |
|
27 |
#: classes/class-bsf-sb-metabox.php:57
|
28 |
msgid "Enter sidebar title here"
|
66 |
msgid "Add locations for where this sidebar should appear."
|
67 |
msgstr ""
|
68 |
|
69 |
+
#: classes/class-bsf-sb-metabox.php:189 classes/class-bsf-sb-post-type.php:69
|
70 |
msgid "Display Rules"
|
71 |
msgstr ""
|
72 |
|
106 |
msgid "Add User Rule"
|
107 |
msgstr ""
|
108 |
|
109 |
+
#: classes/class-bsf-sb-post-type.php:70
|
110 |
+
msgid "Date"
|
111 |
+
msgstr ""
|
112 |
+
|
113 |
+
#: classes/class-bsf-sb-post-type.php:176
|
114 |
msgid "Sidebar"
|
115 |
msgstr ""
|
116 |
|
117 |
+
#: classes/class-bsf-sb-post-type.php:177
|
118 |
+
#: classes/class-bsf-sb-post-type.php:232
|
119 |
msgid "Sidebars"
|
120 |
msgstr ""
|
121 |
|
122 |
+
#: classes/class-bsf-sb-post-type.php:187
|
123 |
msgid "Add New"
|
124 |
msgstr ""
|
125 |
|
126 |
+
#: classes/class-bsf-sb-post-type.php:189
|
127 |
#. translators: %s singular
|
128 |
msgid "Add New %s"
|
129 |
msgstr ""
|
130 |
|
131 |
+
#: classes/class-bsf-sb-post-type.php:191
|
132 |
#. translators: %s singular
|
133 |
msgid "Edit %s"
|
134 |
msgstr ""
|
135 |
|
136 |
+
#: classes/class-bsf-sb-post-type.php:193
|
137 |
#. translators: %s singular
|
138 |
msgid "New %s"
|
139 |
msgstr ""
|
140 |
|
141 |
+
#: classes/class-bsf-sb-post-type.php:196
|
142 |
#. translators: %s singular
|
143 |
msgid "View %s"
|
144 |
msgstr ""
|
145 |
|
146 |
+
#: classes/class-bsf-sb-post-type.php:198
|
147 |
#. translators: %s plural
|
148 |
msgid "Search %s"
|
149 |
msgstr ""
|
150 |
|
151 |
+
#: classes/class-bsf-sb-post-type.php:200
|
152 |
#. translators: %s plural
|
153 |
msgid "No %s Found"
|
154 |
msgstr ""
|
155 |
|
156 |
+
#: classes/class-bsf-sb-post-type.php:202
|
157 |
#. translators: %s plural
|
158 |
msgid "No %s Found In Trash"
|
159 |
msgstr ""
|
231 |
msgid "Advanced"
|
232 |
msgstr ""
|
233 |
|
234 |
+
#: classes/modules/target-rule/class-bsf-sb-target-rules-fields.php:515
|
235 |
+
#: classes/modules/target-rule/class-bsf-sb-target-rules-fields.php:924
|
236 |
msgid "Add Rule"
|
237 |
msgstr ""
|
238 |
|
239 |
+
#: classes/modules/target-rule/class-bsf-sb-target-rules-fields.php:532
|
240 |
+
#: classes/modules/target-rule/class-bsf-sb-target-rules-fields.php:639
|
241 |
+
#: classes/modules/target-rule/class-bsf-sb-target-rules-fields.php:941
|
242 |
+
#: classes/modules/target-rule/class-bsf-sb-target-rules-fields.php:973
|
243 |
+
#: classes/modules/target-rule/class-bsf-sb-target-rules-fields.php:1450
|
244 |
msgid "Select"
|
245 |
msgstr ""
|
246 |
|
247 |
+
#: classes/modules/target-rule/class-bsf-sb-target-rules-fields.php:584
|
248 |
#. translators: %s post label
|
249 |
msgid "All %s"
|
250 |
msgstr ""
|
251 |
|
252 |
+
#: classes/modules/target-rule/class-bsf-sb-target-rules-fields.php:589
|
253 |
+
#: classes/modules/target-rule/class-bsf-sb-target-rules-fields.php:597
|
254 |
#. translators: %s post label
|
255 |
#. translators: %s taxonomy label
|
256 |
msgid "All %s Archive"
|
257 |
msgstr ""
|
258 |
|
259 |
+
#: classes/modules/target-rule/class-bsf-sb-target-rules-fields.php:699
|
260 |
msgid "Add Exclusion Rule"
|
261 |
msgstr ""
|
262 |
|
263 |
+
#: classes/modules/target-rule/class-bsf-sb-target-rules-fields.php:1390
|
264 |
#. translators: %s post title.
|
265 |
msgid "The same display setting is already exist in %s post/s."
|
266 |
msgstr ""
|
267 |
|
268 |
+
#. Plugin Name of the plugin/theme
|
269 |
+
msgid "Sidebar Manager"
|
270 |
+
msgstr ""
|
271 |
+
|
272 |
+
#: includes/white-label.php:22
|
273 |
msgid "Astra SideBar Branding"
|
274 |
msgstr ""
|
275 |
|
276 |
+
#: includes/white-label.php:27
|
277 |
msgid "Plugin Name:"
|
278 |
msgstr ""
|
279 |
|
280 |
+
#: includes/white-label.php:32
|
281 |
msgid "Plugin Description:"
|
282 |
msgstr ""
|
283 |
|
|
|
|
|
|
|
|
|
284 |
#. Plugin URI of the plugin/theme
|
285 |
msgid "http://www.brainstormforce.com"
|
286 |
msgstr ""
|
297 |
msgid "https://www.brainstormforce.com/"
|
298 |
msgstr ""
|
299 |
|
300 |
+
#: classes/class-bsf-sb-post-type.php:184
|
301 |
msgctxt "post type general name"
|
302 |
msgid "Sidebars"
|
303 |
msgstr ""
|
304 |
|
305 |
+
#: classes/class-bsf-sb-post-type.php:185
|
306 |
msgctxt "post type singular name"
|
307 |
msgid "Sidebar"
|
308 |
msgstr ""
|
309 |
|
310 |
+
#: classes/class-bsf-sb-post-type.php:186
|
311 |
msgctxt "admin menu"
|
312 |
msgid "Sidebars"
|
313 |
msgstr ""
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: BrainstormForce
|
|
3 |
Donate link: https://www.paypal.me/BrainstormForce
|
4 |
Tags: custom sidebar, sidebar manager, custom widget areas, widgets, conditional sidebar
|
5 |
Requires at least: 4.0
|
6 |
-
Tested up to: 5.
|
7 |
-
Stable tag: 1.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -19,8 +19,8 @@ This plugin helps you solve that problem as it allows you to create new sidebars
|
|
19 |
Some of the Features:
|
20 |
|
21 |
1. Create unlimited sidebars
|
22 |
-
2. Place them
|
23 |
-
3.
|
24 |
4. Conditionally display sidebars on specific posts, pages, taxonomies or custom post types
|
25 |
5. Display sidebars based on user roles
|
26 |
|
@@ -51,6 +51,10 @@ Other plugins we found are heavy with ugly interface, non supported, developed o
|
|
51 |
|
52 |
== Changelog ==
|
53 |
|
|
|
|
|
|
|
|
|
54 |
v1.0.2
|
55 |
* Improvement: Update target rules with support for targeting all posts inside taxonomies and terms.
|
56 |
* Fix: If a taxonomy is used for multiple post types, it was not displayed in target rules.
|
3 |
Donate link: https://www.paypal.me/BrainstormForce
|
4 |
Tags: custom sidebar, sidebar manager, custom widget areas, widgets, conditional sidebar
|
5 |
Requires at least: 4.0
|
6 |
+
Tested up to: 5.2.2
|
7 |
+
Stable tag: 1.1.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
19 |
Some of the Features:
|
20 |
|
21 |
1. Create unlimited sidebars
|
22 |
+
2. Place them any location your theme has defined (Footer Widgets / Left or Right Sidebar)
|
23 |
+
3. Works with any theme
|
24 |
4. Conditionally display sidebars on specific posts, pages, taxonomies or custom post types
|
25 |
5. Display sidebars based on user roles
|
26 |
|
51 |
|
52 |
== Changelog ==
|
53 |
|
54 |
+
v1.1.0
|
55 |
+
* New: Target rules appearing in Display Rules column for sidebars.
|
56 |
+
* Improvement: White Label can be set from wp-config.php file.
|
57 |
+
|
58 |
v1.0.2
|
59 |
* Improvement: Update target rules with support for targeting all posts inside taxonomies and terms.
|
60 |
* Fix: If a taxonomy is used for multiple post types, it was not displayed in target rules.
|
sidebar-manager.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Sidebar Manager
|
4 |
* Plugin URI: http://www.brainstormforce.com
|
5 |
* Description: This is the plugin to create custom siderbars to your site.
|
6 |
-
* Version: 1.0
|
7 |
* Author: Brainstorm Force
|
8 |
* Author URI: https://www.brainstormforce.com/
|
9 |
* Text Domain: bsfsidebars
|
@@ -25,7 +25,7 @@ define( 'BSF_SB_FILE', __FILE__ );
|
|
25 |
define( 'BSF_SB_BASE', plugin_basename( BSF_SB_FILE ) );
|
26 |
define( 'BSF_SB_DIR', plugin_dir_path( BSF_SB_FILE ) );
|
27 |
define( 'BSF_SB_URL', plugins_url( '/', BSF_SB_FILE ) );
|
28 |
-
define( 'BSF_SB_VER', '1.0
|
29 |
define( 'BSF_SB_PREFIX', 'bsf-sb' );
|
30 |
define( 'BSF_SB_POST_TYPE', 'bsf-sidebar' );
|
31 |
|
3 |
* Plugin Name: Sidebar Manager
|
4 |
* Plugin URI: http://www.brainstormforce.com
|
5 |
* Description: This is the plugin to create custom siderbars to your site.
|
6 |
+
* Version: 1.1.0
|
7 |
* Author: Brainstorm Force
|
8 |
* Author URI: https://www.brainstormforce.com/
|
9 |
* Text Domain: bsfsidebars
|
25 |
define( 'BSF_SB_BASE', plugin_basename( BSF_SB_FILE ) );
|
26 |
define( 'BSF_SB_DIR', plugin_dir_path( BSF_SB_FILE ) );
|
27 |
define( 'BSF_SB_URL', plugins_url( '/', BSF_SB_FILE ) );
|
28 |
+
define( 'BSF_SB_VER', '1.1.0' );
|
29 |
define( 'BSF_SB_PREFIX', 'bsf-sb' );
|
30 |
define( 'BSF_SB_POST_TYPE', 'bsf-sidebar' );
|
31 |
|