Version Description
Download this release
Release Info
Developer | Nikschavan |
Plugin | Astra Bulk Edit |
Version | 1.0.0 |
Comparing to | |
See all releases |
Version 1.0.0
- assets/css/astra-admin.css +15 -0
- assets/js/astra-admin.js +80 -0
- astra-bulk-edit.php +25 -0
- classes/class-astra-blk-meta-boxes-bulk-edit.php +407 -0
- languages/astra-bulk-edit.pot +110 -0
- readme.txt +65 -0
assets/css/astra-admin.css
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*.astra-bulk-settings*/
|
2 |
+
.astra-bulk-settings .inline-edit .title {
|
3 |
+
min-width: 115px;
|
4 |
+
}
|
5 |
+
|
6 |
+
.astra-bulk-settings .inline-edit select {
|
7 |
+
min-width: 200px;
|
8 |
+
}
|
9 |
+
|
10 |
+
.column-astra-settings {
|
11 |
+
display: none;
|
12 |
+
}
|
13 |
+
.ast-float-left {
|
14 |
+
float: left;
|
15 |
+
}
|
assets/js/astra-admin.js
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
* Post Bulk Edit Script
|
3 |
+
* Hooks into the inline post editor functionality to extend it to our custom metadata
|
4 |
+
*/
|
5 |
+
|
6 |
+
jQuery(document).ready(function($){
|
7 |
+
|
8 |
+
//Prepopulating our quick-edit post info
|
9 |
+
var $inline_editor = inlineEditPost.edit;
|
10 |
+
inlineEditPost.edit = function(id){
|
11 |
+
|
12 |
+
//call old copy
|
13 |
+
$inline_editor.apply( this, arguments);
|
14 |
+
|
15 |
+
//our custom functionality below
|
16 |
+
var post_id = 0;
|
17 |
+
if( typeof(id) == 'object'){
|
18 |
+
post_id = parseInt(this.getId(id));
|
19 |
+
}
|
20 |
+
|
21 |
+
//if we have our post
|
22 |
+
if(post_id != 0){
|
23 |
+
|
24 |
+
//find our row
|
25 |
+
var $row = $('#edit-' + post_id);
|
26 |
+
var $fields = $('.astra-bulk-edit-field-' + post_id);
|
27 |
+
|
28 |
+
if ( $fields.length > 0 ) {
|
29 |
+
|
30 |
+
$fields.each(function(i) {
|
31 |
+
|
32 |
+
var field = $(this);
|
33 |
+
var field_name = field.attr('data-name');
|
34 |
+
var field_val = field.text();
|
35 |
+
|
36 |
+
var new_field = $row.find( '#' + field_name );
|
37 |
+
var new_field_type = new_field.attr('type');
|
38 |
+
var new_field_tag = new_field.prop("tagName");
|
39 |
+
|
40 |
+
|
41 |
+
if ( 'SELECT' == new_field_tag ) {
|
42 |
+
new_field.val( field_val );
|
43 |
+
}else if ( 'checkbox' == new_field_type ) {
|
44 |
+
|
45 |
+
if ( 'disabled' == field_val ) {
|
46 |
+
new_field.prop( "checked", true );
|
47 |
+
}
|
48 |
+
}
|
49 |
+
});
|
50 |
+
}
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
|
55 |
+
jQuery( "#bulk_edit" ).on( "click", function(e) {
|
56 |
+
|
57 |
+
// e.preventDefault();
|
58 |
+
|
59 |
+
var bulk_row = jQuery( "#bulk-edit" );
|
60 |
+
var post_ids = new Array();
|
61 |
+
bulk_row.find( "#bulk-titles" ).children().each( function() {
|
62 |
+
post_ids.push( jQuery( this ).attr( "id" ).replace( /^(ttle)/i, "" ) );
|
63 |
+
});
|
64 |
+
|
65 |
+
var form = bulk_row.closest('form');
|
66 |
+
var post_data = form.serialize();
|
67 |
+
|
68 |
+
post_data += '&action=astra_save_post_bulk_edit';
|
69 |
+
|
70 |
+
jQuery.ajax({
|
71 |
+
url: ajaxurl,
|
72 |
+
type: "POST",
|
73 |
+
async: false,
|
74 |
+
cache: false,
|
75 |
+
data: post_data,
|
76 |
+
type: 'POST',
|
77 |
+
dataType: 'json',
|
78 |
+
});
|
79 |
+
});
|
80 |
+
});
|
astra-bulk-edit.php
ADDED
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Plugin Name: Astra Bulk Edit
|
4 |
+
* Plugin URI: http://www.wpastra.com/pro/
|
5 |
+
* Description: Easier way to edit Astra meta options in bulk.
|
6 |
+
* Version: 1.0.0
|
7 |
+
* Author: Brainstorm Force
|
8 |
+
* Author URI: http://www.brainstormforce.com
|
9 |
+
* Domain Path: /languages
|
10 |
+
* Text Domain: astra-bulk-edit
|
11 |
+
* Version: 1.0.0
|
12 |
+
*
|
13 |
+
* @package Astra_Bulk_Edit
|
14 |
+
*/
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Set constants.
|
18 |
+
*/
|
19 |
+
define( 'ASTRA_BLK_VER', '1.0.0' );
|
20 |
+
define( 'ASTRA_BLK_FILE', __FILE__ );
|
21 |
+
define( 'ASTRA_BLK_BASE', plugin_basename( ASTRA_BLK_FILE ) );
|
22 |
+
define( 'ASTRA_BLK_DIR', plugin_dir_path( ASTRA_BLK_FILE ) );
|
23 |
+
define( 'ASTRA_BLK_URI', plugins_url( '/', ASTRA_BLK_FILE ) );
|
24 |
+
|
25 |
+
require_once ASTRA_BLK_DIR . 'classes/class-astra-blk-meta-boxes-bulk-edit.php';
|
classes/class-astra-blk-meta-boxes-bulk-edit.php
ADDED
@@ -0,0 +1,407 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Post Meta Box Bulk Edit
|
4 |
+
*
|
5 |
+
* @package Astra_Bulk_Edit
|
6 |
+
* @copyright Copyright (c) 2017, Astra
|
7 |
+
* @link http://wpastra.com/
|
8 |
+
* @since 1.0.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Meta Boxes setup
|
13 |
+
*/
|
14 |
+
if ( ! class_exists( 'Astra_Blk_Meta_Boxes_Bulk_Edit' ) ) {
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Meta Boxes setup
|
18 |
+
*/
|
19 |
+
class Astra_Blk_Meta_Boxes_Bulk_Edit {
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Instance
|
23 |
+
*
|
24 |
+
* @var $instance
|
25 |
+
*/
|
26 |
+
private static $instance;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Meta Option
|
30 |
+
*
|
31 |
+
* @var $meta_option
|
32 |
+
*/
|
33 |
+
private static $meta_option;
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Initiator
|
37 |
+
*/
|
38 |
+
public static function get_instance() {
|
39 |
+
if ( ! isset( self::$instance ) ) {
|
40 |
+
self::$instance = new self;
|
41 |
+
}
|
42 |
+
return self::$instance;
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Constructor
|
47 |
+
*/
|
48 |
+
public function __construct() {
|
49 |
+
|
50 |
+
add_action( 'admin_init', array( $this, 'setup_admin_init' ), 999 );
|
51 |
+
|
52 |
+
// output form elements for quickedit interface.
|
53 |
+
add_action( 'bulk_edit_custom_box', array( $this, 'display_quick_edit_custom' ), 10, 2 );
|
54 |
+
add_action( 'quick_edit_custom_box', array( $this, 'display_quick_edit_custom' ), 10, 2 );
|
55 |
+
|
56 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts_and_styles' ) );
|
57 |
+
|
58 |
+
add_action( 'save_post', array( $this, 'save_meta_box' ) );
|
59 |
+
|
60 |
+
add_action( 'wp_ajax_astra_save_post_bulk_edit', array( $this, 'save_post_bulk_edit' ) );
|
61 |
+
}
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Admin Init actions
|
65 |
+
*/
|
66 |
+
function setup_admin_init() {
|
67 |
+
|
68 |
+
$this->setup_bulk_options();
|
69 |
+
|
70 |
+
// Get all public posts.
|
71 |
+
$post_types = get_post_types(
|
72 |
+
array(
|
73 |
+
'public' => true,
|
74 |
+
)
|
75 |
+
);
|
76 |
+
|
77 |
+
// Enable for all posts.
|
78 |
+
foreach ( $post_types as $type ) {
|
79 |
+
|
80 |
+
if ( 'attachment' !== $type && 'fl-theme-layout' !== $type ) {
|
81 |
+
// add custom column.
|
82 |
+
add_action( 'manage_' . $type . '_posts_columns', array( $this, 'add_custom_admin_column' ), 10, 1 );
|
83 |
+
// populate column.
|
84 |
+
add_action( 'manage_' . $type . '_posts_custom_column', array( $this, 'manage_custom_admin_columns' ), 10, 2 );
|
85 |
+
}
|
86 |
+
}
|
87 |
+
}
|
88 |
+
|
89 |
+
/**
|
90 |
+
* Init bulk options
|
91 |
+
*/
|
92 |
+
function setup_bulk_options() {
|
93 |
+
|
94 |
+
/**
|
95 |
+
* Set metabox options
|
96 |
+
*
|
97 |
+
* @see http://php.net/manual/en/filter.filters.sanitize.php
|
98 |
+
*/
|
99 |
+
self::$meta_option = apply_filters(
|
100 |
+
'astra_meta_box_bulk_edit_options', array(
|
101 |
+
'ast-main-header-display' => array(
|
102 |
+
'sanitize' => 'FILTER_DEFAULT',
|
103 |
+
),
|
104 |
+
'ast-featured-img' => array(
|
105 |
+
'sanitize' => 'FILTER_DEFAULT',
|
106 |
+
),
|
107 |
+
'site-post-title' => array(
|
108 |
+
'sanitize' => 'FILTER_DEFAULT',
|
109 |
+
),
|
110 |
+
'site-sidebar-layout' => array(
|
111 |
+
'default' => 'default',
|
112 |
+
'sanitize' => 'FILTER_DEFAULT',
|
113 |
+
),
|
114 |
+
'site-content-layout' => array(
|
115 |
+
'default' => 'default',
|
116 |
+
'sanitize' => 'FILTER_DEFAULT',
|
117 |
+
),
|
118 |
+
'footer-sml-layout' => array(
|
119 |
+
'sanitize' => 'FILTER_DEFAULT',
|
120 |
+
),
|
121 |
+
'footer-adv-display' => array(
|
122 |
+
'sanitize' => 'FILTER_DEFAULT',
|
123 |
+
),
|
124 |
+
)
|
125 |
+
);
|
126 |
+
}
|
127 |
+
|
128 |
+
/**
|
129 |
+
* Get metabox options
|
130 |
+
*/
|
131 |
+
public static function get_meta_option() {
|
132 |
+
return self::$meta_option;
|
133 |
+
}
|
134 |
+
|
135 |
+
/**
|
136 |
+
* Metabox Save
|
137 |
+
*
|
138 |
+
* @param number $post_id Post ID.
|
139 |
+
* @return void
|
140 |
+
*/
|
141 |
+
function save_meta_box( $post_id ) {
|
142 |
+
|
143 |
+
// Checks save status.
|
144 |
+
$is_autosave = wp_is_post_autosave( $post_id );
|
145 |
+
$is_revision = wp_is_post_revision( $post_id );
|
146 |
+
$is_valid_nonce = ( isset( $_POST['astra_settings_bulk_meta_box'] ) && wp_verify_nonce( $_POST['astra_settings_bulk_meta_box'], basename( __FILE__ ) ) ) ? true : false;
|
147 |
+
|
148 |
+
// Exits script depending on save status.
|
149 |
+
if ( $is_autosave || $is_revision || ! $is_valid_nonce ) {
|
150 |
+
return;
|
151 |
+
}
|
152 |
+
|
153 |
+
/**
|
154 |
+
* Get meta options
|
155 |
+
*/
|
156 |
+
$post_meta = self::get_meta_option();
|
157 |
+
|
158 |
+
foreach ( $post_meta as $key => $data ) {
|
159 |
+
|
160 |
+
// Sanitize values.
|
161 |
+
$sanitize_filter = ( isset( $data['sanitize'] ) ) ? $data['sanitize'] : 'FILTER_DEFAULT';
|
162 |
+
|
163 |
+
switch ( $sanitize_filter ) {
|
164 |
+
|
165 |
+
case 'FILTER_SANITIZE_STRING':
|
166 |
+
$meta_value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_STRING );
|
167 |
+
break;
|
168 |
+
|
169 |
+
case 'FILTER_SANITIZE_URL':
|
170 |
+
$meta_value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_URL );
|
171 |
+
break;
|
172 |
+
|
173 |
+
case 'FILTER_SANITIZE_NUMBER_INT':
|
174 |
+
$meta_value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_NUMBER_INT );
|
175 |
+
break;
|
176 |
+
|
177 |
+
default:
|
178 |
+
$meta_value = filter_input( INPUT_POST, $key, FILTER_DEFAULT );
|
179 |
+
break;
|
180 |
+
}
|
181 |
+
|
182 |
+
// Store values.
|
183 |
+
if ( $meta_value ) {
|
184 |
+
update_post_meta( $post_id, $key, $meta_value );
|
185 |
+
} else {
|
186 |
+
delete_post_meta( $post_id, $key );
|
187 |
+
}
|
188 |
+
}
|
189 |
+
|
190 |
+
}
|
191 |
+
|
192 |
+
/**
|
193 |
+
* Save bulk edit options.
|
194 |
+
*/
|
195 |
+
function save_post_bulk_edit() {
|
196 |
+
|
197 |
+
$post_ids = ! empty( $_POST['post'] ) ? $_POST['post'] : array();
|
198 |
+
|
199 |
+
if ( ! empty( $post_ids ) && is_array( $post_ids ) ) {
|
200 |
+
|
201 |
+
/**
|
202 |
+
* Get meta options
|
203 |
+
*/
|
204 |
+
$post_meta = self::get_meta_option();
|
205 |
+
|
206 |
+
foreach ( $post_ids as $post_id ) {
|
207 |
+
|
208 |
+
foreach ( $post_meta as $key => $data ) {
|
209 |
+
|
210 |
+
// Sanitize values.
|
211 |
+
$sanitize_filter = ( isset( $data['sanitize'] ) ) ? $data['sanitize'] : 'FILTER_DEFAULT';
|
212 |
+
|
213 |
+
switch ( $sanitize_filter ) {
|
214 |
+
|
215 |
+
case 'FILTER_SANITIZE_STRING':
|
216 |
+
$meta_value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_STRING );
|
217 |
+
break;
|
218 |
+
|
219 |
+
case 'FILTER_SANITIZE_URL':
|
220 |
+
$meta_value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_URL );
|
221 |
+
break;
|
222 |
+
|
223 |
+
case 'FILTER_SANITIZE_NUMBER_INT':
|
224 |
+
$meta_value = filter_input( INPUT_POST, $key, FILTER_SANITIZE_NUMBER_INT );
|
225 |
+
break;
|
226 |
+
|
227 |
+
default:
|
228 |
+
$meta_value = filter_input( INPUT_POST, $key, FILTER_DEFAULT );
|
229 |
+
break;
|
230 |
+
}
|
231 |
+
|
232 |
+
// Store values.
|
233 |
+
if ( $meta_value ) {
|
234 |
+
update_post_meta( $post_id, $key, $meta_value );
|
235 |
+
} else {
|
236 |
+
delete_post_meta( $post_id, $key );
|
237 |
+
}
|
238 |
+
}
|
239 |
+
}
|
240 |
+
}
|
241 |
+
|
242 |
+
die();
|
243 |
+
}
|
244 |
+
|
245 |
+
/**
|
246 |
+
* Quick edit custom column to hold our data
|
247 |
+
*
|
248 |
+
* @param number $columns Columns.
|
249 |
+
* @return array Column array.
|
250 |
+
*/
|
251 |
+
function add_custom_admin_column( $columns ) {
|
252 |
+
$new_columns = array();
|
253 |
+
|
254 |
+
$new_columns['astra-settings'] = 'Astra Settings';
|
255 |
+
|
256 |
+
return array_merge( $columns, $new_columns );
|
257 |
+
}
|
258 |
+
|
259 |
+
/**
|
260 |
+
* Customize the data for our custom column,
|
261 |
+
* It's here we pull in metadata info for each post.
|
262 |
+
* These will be referred to in our JavaScript file for pre-populating our quick-edit screen
|
263 |
+
*
|
264 |
+
* @param string $column_name Column name.
|
265 |
+
* @param number $post_id Post ID.
|
266 |
+
* @return void
|
267 |
+
*/
|
268 |
+
function manage_custom_admin_columns( $column_name, $post_id ) {
|
269 |
+
|
270 |
+
if ( 'astra-settings' == $column_name ) {
|
271 |
+
|
272 |
+
$html = '';
|
273 |
+
|
274 |
+
$stored = get_post_meta( $post_id );
|
275 |
+
$meta = self::get_meta_option();
|
276 |
+
|
277 |
+
// Set stored and override defaults.
|
278 |
+
foreach ( $stored as $key => $value ) {
|
279 |
+
if ( array_key_exists( $key, $meta ) ) {
|
280 |
+
$meta[ $key ]['default'] = ( isset( $stored[ $key ][0] ) ) ? $stored[ $key ][0] : '';
|
281 |
+
}
|
282 |
+
}
|
283 |
+
|
284 |
+
foreach ( $meta as $key => $value ) {
|
285 |
+
|
286 |
+
$default_value = '';
|
287 |
+
|
288 |
+
$html .= '<div class="astra-bulk-edit-field-' . $post_id . '" data-name="' . $key . '" id="' . $key . '-' . $post_id . '">';
|
289 |
+
|
290 |
+
if ( isset( $meta[ $key ]['default'] ) ) {
|
291 |
+
$default_value = $meta[ $key ]['default'];
|
292 |
+
}
|
293 |
+
|
294 |
+
$html .= $default_value;
|
295 |
+
$html .= '</div>';
|
296 |
+
}
|
297 |
+
|
298 |
+
echo $html;
|
299 |
+
}
|
300 |
+
|
301 |
+
}
|
302 |
+
|
303 |
+
/**
|
304 |
+
* Display our custom content on the quick-edit interface,
|
305 |
+
* no values can be pre-populated (all done in JavaScript)
|
306 |
+
*
|
307 |
+
* @param string $column Column name.
|
308 |
+
* @param string $screen Screen.
|
309 |
+
* @return void
|
310 |
+
*/
|
311 |
+
function display_quick_edit_custom( $column, $screen ) {
|
312 |
+
|
313 |
+
$html = '';
|
314 |
+
|
315 |
+
wp_nonce_field( basename( __FILE__ ), 'astra_settings_bulk_meta_box' );
|
316 |
+
|
317 |
+
if ( 'astra-settings' == $column ) { ?>
|
318 |
+
<fieldset class="astra-bulk-settings inline-edit-col ">
|
319 |
+
<div class="inline-edit-col wp-clearfix">
|
320 |
+
|
321 |
+
<h4 class="title"><?php esc_html_e( 'Astra Setting', 'astra-bulk-edit' ); ?></h4>
|
322 |
+
|
323 |
+
<div class="ast-float-left inline-edit-col-left wp-clearfix">
|
324 |
+
<label class="inline-edit" for="site-sidebar-layout">
|
325 |
+
<span class="title"><?php esc_html_e( 'Sidebar', 'astra-bulk-edit' ); ?></span>
|
326 |
+
|
327 |
+
<select name="site-sidebar-layout" id="site-sidebar-layout">
|
328 |
+
<option value="default" selected="selected"><?php _e( 'Customizer Setting', 'astra-bulk-edit' ); ?></option>
|
329 |
+
<option value="left-sidebar"><?php _e( 'Left Sidebar', 'astra-bulk-edit' ); ?></option>
|
330 |
+
<option value="right-sidebar"><?php _e( 'Right Sidebar', 'astra-bulk-edit' ); ?></option>
|
331 |
+
<option value="no-sidebar"><?php _e( 'No Sidebar', 'astra-bulk-edit' ); ?></option>
|
332 |
+
</select>
|
333 |
+
</label>
|
334 |
+
|
335 |
+
<label class="inline-edit" for="site-content-layout">
|
336 |
+
<span class="title"><?php esc_html_e( 'Content Layout', 'astra-bulk-edit' ); ?></span>
|
337 |
+
|
338 |
+
<select name="site-content-layout" id="site-content-layout">
|
339 |
+
<option value="default" selected="selected"><?php _e( 'Customizer Setting', 'astra-bulk-edit' ); ?></option>
|
340 |
+
<option value="content-boxed-container"><?php _e( 'Boxed', 'astra-bulk-edit' ); ?></option>
|
341 |
+
<option value="content-boxed-container"><?php _e( 'Content Boxed', 'astra-bulk-edit' ); ?></option>
|
342 |
+
<option value="plain-container"><?php _e( 'Full Width / Contained', 'astra-bulk-edit' ); ?></option>
|
343 |
+
<option value="page-builder"><?php _e( 'Full Width / Stretched', 'astra-bulk-edit' ); ?></option>
|
344 |
+
</select>
|
345 |
+
</label>
|
346 |
+
|
347 |
+
<?php do_action( 'astra_meta_bulk_edit_left_bottom' ); ?>
|
348 |
+
</div>
|
349 |
+
|
350 |
+
<div class="ast-float-left inline-edit-col-center wp-clearfix">
|
351 |
+
<label class="inline-edit" for="ast-main-header-display">
|
352 |
+
<input type="checkbox" id="ast-main-header-display" name="ast-main-header-display" value="disabled"/>
|
353 |
+
<?php _e( 'Disable Primary Header', 'astra-bulk-edit' ); ?>
|
354 |
+
</label>
|
355 |
+
|
356 |
+
<label class="inline-edit" for="site-post-title">
|
357 |
+
<input type="checkbox" id="site-post-title" name="site-post-title" value="disabled"/>
|
358 |
+
<?php _e( 'Disable Title', 'astra-bulk-edit' ); ?>
|
359 |
+
</label>
|
360 |
+
|
361 |
+
<label class="inline-edit" for="ast-featured-img">
|
362 |
+
<input type="checkbox" id="ast-featured-img" name="ast-featured-img" value="disabled"/>
|
363 |
+
<?php _e( 'Disable Featured Image', 'astra-bulk-edit' ); ?>
|
364 |
+
</label>
|
365 |
+
|
366 |
+
<?php
|
367 |
+
$footer_adv_layout = astra_get_option( 'footer-adv' );
|
368 |
+
if ( 'disabled' != $footer_adv_layout ) {
|
369 |
+
?>
|
370 |
+
<label class="inline-edit" for="footer-adv-display">
|
371 |
+
<input type="checkbox" id="footer-adv-display" name="footer-adv-display" value="disabled"/>
|
372 |
+
<?php _e( 'Disable Footer Widgets', 'astra-bulk-edit' ); ?>
|
373 |
+
</label>
|
374 |
+
<?php } ?>
|
375 |
+
|
376 |
+
<?php
|
377 |
+
$footer_sml_layout = astra_get_option( 'footer-sml-layout' );
|
378 |
+
if ( 'disabled' != $footer_sml_layout ) {
|
379 |
+
?>
|
380 |
+
<label class="inline-edit" for="footer-sml-layout">
|
381 |
+
<input type="checkbox" id="footer-sml-layout" name="footer-sml-layout" value="disabled"/>
|
382 |
+
<?php _e( 'Disable Footer Bar', 'astra-bulk-edit' ); ?>
|
383 |
+
</label>
|
384 |
+
<?php } ?>
|
385 |
+
|
386 |
+
<?php do_action( 'astra_meta_bulk_edit_center_bottom' ); ?>
|
387 |
+
</div>
|
388 |
+
</div>
|
389 |
+
</fieldset>;
|
390 |
+
<?php
|
391 |
+
}
|
392 |
+
}
|
393 |
+
|
394 |
+
/**
|
395 |
+
* Quick edit and bulk edit script function.
|
396 |
+
*/
|
397 |
+
function enqueue_admin_scripts_and_styles() {
|
398 |
+
wp_enqueue_style( 'astra-blk-admin', ASTRA_BLK_URI . 'assets/css/astra-admin.css', array(), ASTRA_BLK_VER );
|
399 |
+
wp_enqueue_script( 'astra-blk-admin', ASTRA_BLK_URI . 'assets/js/astra-admin.js', array( 'jquery', 'inline-edit-post' ), ASTRA_BLK_VER );
|
400 |
+
}
|
401 |
+
}
|
402 |
+
}// End if().
|
403 |
+
|
404 |
+
/**
|
405 |
+
* Kicking this off by calling 'get_instance()' method
|
406 |
+
*/
|
407 |
+
Astra_Blk_Meta_Boxes_Bulk_Edit::get_instance();
|
languages/astra-bulk-edit.pot
ADDED
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Copyright (C) 2017 Brainstorm Force
|
2 |
+
# This file is distributed under the same license as the Astra Bulk Edit package.
|
3 |
+
msgid ""
|
4 |
+
msgstr ""
|
5 |
+
"Project-Id-Version: Astra Bulk Edit 1.0.0\n"
|
6 |
+
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/astra-bulk-edit\n"
|
7 |
+
"POT-Creation-Date: 2017-11-14 05:12:01+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: 2017-MO-DA HO:MI+ZONE\n"
|
12 |
+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
13 |
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
14 |
+
"X-Generator: grunt-wp-i18n 0.5.4\n"
|
15 |
+
"X-Poedit-KeywordsList: "
|
16 |
+
"__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_"
|
17 |
+
"attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n"
|
18 |
+
"Language: en\n"
|
19 |
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
20 |
+
"X-Poedit-Country: United States\n"
|
21 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
22 |
+
"X-Poedit-Basepath: ../\n"
|
23 |
+
"X-Poedit-SearchPath-0: .\n"
|
24 |
+
"X-Poedit-Bookmarks: \n"
|
25 |
+
"X-Textdomain-Support: yes\n"
|
26 |
+
|
27 |
+
#: classes/class-astra-blk-meta-boxes-bulk-edit.php:313
|
28 |
+
msgid "Astra Setting"
|
29 |
+
msgstr ""
|
30 |
+
|
31 |
+
#: classes/class-astra-blk-meta-boxes-bulk-edit.php:317
|
32 |
+
msgid "Sidebar"
|
33 |
+
msgstr ""
|
34 |
+
|
35 |
+
#: classes/class-astra-blk-meta-boxes-bulk-edit.php:320
|
36 |
+
#: classes/class-astra-blk-meta-boxes-bulk-edit.php:331
|
37 |
+
msgid "Customizer Setting"
|
38 |
+
msgstr ""
|
39 |
+
|
40 |
+
#: classes/class-astra-blk-meta-boxes-bulk-edit.php:321
|
41 |
+
msgid "Left Sidebar"
|
42 |
+
msgstr ""
|
43 |
+
|
44 |
+
#: classes/class-astra-blk-meta-boxes-bulk-edit.php:322
|
45 |
+
msgid "Right Sidebar"
|
46 |
+
msgstr ""
|
47 |
+
|
48 |
+
#: classes/class-astra-blk-meta-boxes-bulk-edit.php:323
|
49 |
+
msgid "No Sidebar"
|
50 |
+
msgstr ""
|
51 |
+
|
52 |
+
#: classes/class-astra-blk-meta-boxes-bulk-edit.php:328
|
53 |
+
msgid "Content Layout"
|
54 |
+
msgstr ""
|
55 |
+
|
56 |
+
#: classes/class-astra-blk-meta-boxes-bulk-edit.php:332
|
57 |
+
msgid "Boxed"
|
58 |
+
msgstr ""
|
59 |
+
|
60 |
+
#: classes/class-astra-blk-meta-boxes-bulk-edit.php:333
|
61 |
+
msgid "Content Boxed"
|
62 |
+
msgstr ""
|
63 |
+
|
64 |
+
#: classes/class-astra-blk-meta-boxes-bulk-edit.php:334
|
65 |
+
msgid "Full Width / Contained"
|
66 |
+
msgstr ""
|
67 |
+
|
68 |
+
#: classes/class-astra-blk-meta-boxes-bulk-edit.php:335
|
69 |
+
msgid "Full Width / Stretched"
|
70 |
+
msgstr ""
|
71 |
+
|
72 |
+
#: classes/class-astra-blk-meta-boxes-bulk-edit.php:345
|
73 |
+
msgid "Disable Primary Header"
|
74 |
+
msgstr ""
|
75 |
+
|
76 |
+
#: classes/class-astra-blk-meta-boxes-bulk-edit.php:350
|
77 |
+
msgid "Disable Title"
|
78 |
+
msgstr ""
|
79 |
+
|
80 |
+
#: classes/class-astra-blk-meta-boxes-bulk-edit.php:355
|
81 |
+
msgid "Disable Featured Image"
|
82 |
+
msgstr ""
|
83 |
+
|
84 |
+
#: classes/class-astra-blk-meta-boxes-bulk-edit.php:364
|
85 |
+
msgid "Disable Footer Widgets"
|
86 |
+
msgstr ""
|
87 |
+
|
88 |
+
#: classes/class-astra-blk-meta-boxes-bulk-edit.php:374
|
89 |
+
msgid "Disable Footer Bar"
|
90 |
+
msgstr ""
|
91 |
+
|
92 |
+
#. Plugin Name of the plugin/theme
|
93 |
+
msgid "Astra Bulk Edit"
|
94 |
+
msgstr ""
|
95 |
+
|
96 |
+
#. Plugin URI of the plugin/theme
|
97 |
+
msgid "http://www.wpastra.com/pro/"
|
98 |
+
msgstr ""
|
99 |
+
|
100 |
+
#. Description of the plugin/theme
|
101 |
+
msgid "Easier way to edit Astra meta options in bulk."
|
102 |
+
msgstr ""
|
103 |
+
|
104 |
+
#. Author of the plugin/theme
|
105 |
+
msgid "Brainstorm Force"
|
106 |
+
msgstr ""
|
107 |
+
|
108 |
+
#. Author URI of the plugin/theme
|
109 |
+
msgid "http://www.brainstormforce.com"
|
110 |
+
msgstr ""
|
readme.txt
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== Astra Bulk Edit ===
|
2 |
+
Contributors: brainstormforce
|
3 |
+
Donate link: https://wpastra.com/
|
4 |
+
Tags: bulk edit Astra meta settings, Astra meta settings, meta settings bulk edit, wordpress bulk edit plugin, page bulk edit, post bulk edit
|
5 |
+
Requires at least: 4.4
|
6 |
+
Tested up to: 4.9
|
7 |
+
Stable tag: 1.0.0
|
8 |
+
Requires PHP: 5.2
|
9 |
+
License: GPLv2 or later
|
10 |
+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
+
|
12 |
+
An easy-to-use plugin for the Astra theme that lets you edit Page Meta Settings for multiple pages/posts at once.
|
13 |
+
|
14 |
+
== Description ==
|
15 |
+
|
16 |
+
The Astra Bulk Edit plugin is useful for editing Astra Meta settings on a number of pages/posts at once.
|
17 |
+
|
18 |
+
Some examples:
|
19 |
+
1. Enable or Disable the Page Title from multiple pages.
|
20 |
+
2. Make the pages full width.
|
21 |
+
|
22 |
+
It reduces the pain of opening each page/post and modifying it as required.
|
23 |
+
|
24 |
+
<strong>Note:</strong>
|
25 |
+
|
26 |
+
The Astra Bulk Edit plugin is created for the <a href="https://wpastra.com/?utm_source=wp-repo&utm_campaign=astra-bulk-edit&utm_medium=description">Astra theme</a>. You should have the Astra theme installed and activated on your website.
|
27 |
+
|
28 |
+
https://www.youtube.com/watch?v=mQlTDTXQ8aw
|
29 |
+
|
30 |
+
== What’s More? ==
|
31 |
+
|
32 |
+
<a href="https://www.brainstormforce.com/go/astra-hooks/?utm_source=wp-repo&utm_campaign=astra-bulk-edit&utm_medium=plugins">Astra Hooks</a>: The Astra Hooks plugin allows you to insert actions throughout the theme. It allows you to hook custom content, JavaScript code, shortcodes, etc in various hook locations.
|
33 |
+
|
34 |
+
<a href="https://www.brainstormforce.com/go/astra-customizer-reset/?utm_source=wp-repo&utm_campaign=astra-bulk-edit&utm_medium=plugins">Astra Customizer Reset</a>: Wish to revert some customization settings that you’ve made in the Astra theme? The Astra Customizer Reset plugin allows you to do this through the customizer itself.
|
35 |
+
|
36 |
+
<a href="https://www.brainstormforce.com/go/custom-typekit-fonts/?utm_source=wp-repo&utm_campaign=astra-bulk-edit&utm_medium=plugins">Custom Typekit Fonts</a>: The Custom Typekit Font plugin lets you to extend font support from typekit.
|
37 |
+
|
38 |
+
|
39 |
+
== Installation ==
|
40 |
+
|
41 |
+
1. Make sure you have the Astra theme installed and activated.
|
42 |
+
2. Upload the plugin files to the `/wp-content/plugins/` directory, or install the plugin through the WordPress plugins screen directly.
|
43 |
+
3. Activate the plugin through the 'Plugins' screen in WordPress
|
44 |
+
4. Once activated, you’ll find the Astra Meta settings appear in the bulk edit screen for pages/posts.
|
45 |
+
|
46 |
+
== Frequently Asked Questions ==
|
47 |
+
|
48 |
+
= Which theme can I use this plugin with? =
|
49 |
+
|
50 |
+
Astra Bulk Edit plugin can be used only with the Astra theme.
|
51 |
+
|
52 |
+
= How does this plugin work? =
|
53 |
+
|
54 |
+
1.Install and activate the plugin
|
55 |
+
2.Open the bulk edit option for pages/posts. You will see the Astra Meta Settings appear on the screen. Refer screenshots. <a href="https://i.imgur.com/jte7sk8.jpg">https://i.imgur.com/jte7sk8.jpg</a>
|
56 |
+
|
57 |
+
== Screenshots ==
|
58 |
+
1. Bulk edit settings.
|
59 |
+
2. Astra Meta Settings which can be bulk edited.
|
60 |
+
|
61 |
+
== Changelog ==
|
62 |
+
|
63 |
+
= 1.0 =
|
64 |
+
* Initial Release
|
65 |
+
== Upgrade Notice ==
|