| 1 |
<?php |
| 2 |
/** |
| 3 |
* Bulk Edit view |
| 4 |
* |
| 5 |
* @package ConvertKit |
| 6 |
* @author ConvertKit |
| 7 |
*/ |
| 8 |
|
| 9 |
?> |
| 10 |
<div id="convertkit-bulk-edit" class="convertkit-bulk-quick-edit" style="display:none;"> |
| 11 |
<!-- Form --> |
| 12 |
<div> |
| 13 |
<label for="wp-convertkit-bulk-edit-form"> |
| 14 |
<span class="title convertkit-icon-form"><?php esc_html_e( 'Form', 'convertkit' ); ?></span> |
| 15 |
|
| 16 |
<?php |
| 17 |
// For Bulk Edit, the 'No Change' value is -1. However, because this Plugin has historically used -1 |
| 18 |
// to mean that the Default form for the Post Type should be displayed, using -1 as 'No Change' in Bulk Edit |
| 19 |
// would result in Posts/Pages having (or not having) the Form setting updated, when the user may/may not |
| 20 |
// have selected the 'Default' option. |
| 21 |
// Therefore, we use -2 to denote 'No Change'. |
| 22 |
echo $convertkit_forms->get_select_field_all( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 23 |
'wp-convertkit[form]', |
| 24 |
'wp-convertkit-bulk-edit-form', |
| 25 |
false, |
| 26 |
false, |
| 27 |
array( |
| 28 |
'-2' => esc_html__( '— No Change —', 'convertkit' ), |
| 29 |
'-1' => esc_html__( 'Default', 'convertkit' ), |
| 30 |
'0' => esc_html__( 'None', 'convertkit' ), |
| 31 |
) |
| 32 |
); |
| 33 |
?> |
| 34 |
</label> |
| 35 |
<button class="wp-convertkit-refresh-resources" class="button button-secondary" title="<?php esc_attr_e( 'Refresh Forms from ConvertKit account', 'convertkit' ); ?>" data-resource="forms" data-field="#wp-convertkit-bulk-edit-form"> |
| 36 |
<span class="dashicons dashicons-update"></span> |
| 37 |
</button> |
| 38 |
</div> |
| 39 |
|
| 40 |
<!-- Tag --> |
| 41 |
<div> |
| 42 |
<label for="wp-convertkit-bulk-edit-tag"> |
| 43 |
<span class="title convertkit-icon-tag"><?php esc_html_e( 'Tag', 'convertkit' ); ?></span> |
| 44 |
<select name="wp-convertkit[tag]" id="wp-convertkit-bulk-edit-tag" size="1"> |
| 45 |
<?php |
| 46 |
// For Bulk Edit, the 'No Change' value is -1. However, because this Plugin has historically used -1 |
| 47 |
// to mean that the Default form for the Post Type should be displayed, using -1 as 'No Change' in Bulk Edit |
| 48 |
// would result in Posts/Pages having (or not having) the Form setting updated, when the user may/may not |
| 49 |
// have selected the 'Default' option. |
| 50 |
// Therefore, we use -2 to denote 'No Change', even though this setting is for the Tag, so we're at least consistent. |
| 51 |
?> |
| 52 |
<option value="-2" data-preserve-on-refresh="1"><?php esc_html_e( '— No Change —', 'convertkit' ); ?></option> |
| 53 |
<option value="0" data-preserve-on-refresh="1"><?php esc_html_e( 'None', 'convertkit' ); ?></option> |
| 54 |
<?php |
| 55 |
if ( $convertkit_tags->exist() ) { |
| 56 |
foreach ( $convertkit_tags->get() as $convertkit_tag ) { |
| 57 |
?> |
| 58 |
<option value="<?php echo esc_attr( $convertkit_tag['id'] ); ?>"><?php echo esc_attr( $convertkit_tag['name'] ); ?></option> |
| 59 |
<?php |
| 60 |
} |
| 61 |
} |
| 62 |
?> |
| 63 |
</select> |
| 64 |
</label> |
| 65 |
<button class="wp-convertkit-refresh-resources" class="button button-secondary" title="<?php esc_attr_e( 'Refresh Tags from ConvertKit account', 'convertkit' ); ?>" data-resource="tags" data-field="#wp-convertkit-bulk-edit-tag"> |
| 66 |
<span class="dashicons dashicons-update"></span> |
| 67 |
</button> |
| 68 |
</div> |
| 69 |
|
| 70 |
<!-- Restrict Content --> |
| 71 |
<div> |
| 72 |
<label for="wp-convertkit-bulk-edit-restrict_content"> |
| 73 |
<span class="title convertkit-icon-restrict-content"><?php esc_html_e( 'Member', 'convertkit' ); ?></span> |
| 74 |
<select name="wp-convertkit[restrict_content]" id="wp-convertkit-bulk-edit-restrict_content" size="1"> |
| 75 |
<?php |
| 76 |
// For Bulk Edit, the 'No Change' value is -1. However, because this Plugin has historically used -1 |
| 77 |
// to mean that the Default form for the Post Type should be displayed, using -1 as 'No Change' in Bulk Edit |
| 78 |
// would result in Posts/Pages having (or not having) the Form setting updated, when the user may/may not |
| 79 |
// have selected the 'Default' option. |
| 80 |
// Therefore, we use -2 to denote 'No Change', even though this setting is for the Tag, so we're at least consistent. |
| 81 |
?> |
| 82 |
<option value="-2" data-preserve-on-refresh="1"><?php esc_html_e( '— No Change —', 'convertkit' ); ?></option> |
| 83 |
<option value="0" data-preserve-on-refresh="1"><?php esc_html_e( 'Don\'t restrict content to members only.', 'convertkit' ); ?></option> |
| 84 |
|
| 85 |
<optgroup label="<?php esc_attr_e( 'Tags', 'convertkit' ); ?>" data-resource="tags"> |
| 86 |
<?php |
| 87 |
// Tags. |
| 88 |
if ( $convertkit_tags->exist() ) { |
| 89 |
foreach ( $convertkit_tags->get() as $convertkit_tag ) { |
| 90 |
?> |
| 91 |
<option value="tag_<?php echo esc_attr( $convertkit_tag['id'] ); ?>"><?php echo esc_attr( $convertkit_tag['name'] ); ?></option> |
| 92 |
<?php |
| 93 |
} |
| 94 |
} |
| 95 |
?> |
| 96 |
</optgroup> |
| 97 |
|
| 98 |
<optgroup label="<?php esc_attr_e( 'Products', 'convertkit' ); ?>" data-resource="products"> |
| 99 |
<?php |
| 100 |
// Products. |
| 101 |
if ( $convertkit_products->exist() ) { |
| 102 |
foreach ( $convertkit_products->get() as $product ) { |
| 103 |
?> |
| 104 |
<option value="product_<?php echo esc_attr( $product['id'] ); ?>"><?php echo esc_attr( $product['name'] ); ?></option> |
| 105 |
<?php |
| 106 |
} |
| 107 |
} |
| 108 |
?> |
| 109 |
</optgroup> |
| 110 |
</select> |
| 111 |
</label> |
| 112 |
<button class="wp-convertkit-refresh-resources" class="button button-secondary" title="<?php esc_attr_e( 'Refresh Products and Tags from ConvertKit account', 'convertkit' ); ?>" data-resource="restrict_content" data-field="#wp-convertkit-bulk-edit-restrict_content"> |
| 113 |
<span class="dashicons dashicons-update"></span> |
| 114 |
</button> |
| 115 |
</div> |
| 116 |
<?php |
| 117 |
wp_nonce_field( 'wp-convertkit-save-meta', 'wp-convertkit-save-meta-nonce' ); |
| 118 |
?> |
| 119 |
</div> |
| 120 |
|