| 1 |
<?php |
| 2 |
/** |
| 3 |
* Outputs the single status configuration form. Its values are populated by statuses.js, based |
| 4 |
* on the status that has been selected for editing. |
| 5 |
* |
| 6 |
* @package WPZinc\Social |
| 7 |
* @author WP Zinc |
| 8 |
*/ |
| 9 |
|
| 10 |
if ( ! defined( 'ABSPATH' ) ) { |
| 11 |
exit; // Exit if accessed directly. |
| 12 |
} |
| 13 |
?> |
| 14 |
<div id="<?php echo esc_attr( $this->base->plugin->name ); ?>-status-form-container" class="hidden"> |
| 15 |
<div id="<?php echo esc_attr( $this->base->plugin->name ); ?>-status-form" class="wpzinc-social-status-form"> |
| 16 |
<div class="notice-inline notice-warning pinterest hidden full"> |
| 17 |
<p> |
| 18 |
<?php |
| 19 |
esc_html_e( 'You need to create at least one Pinterest Board, and then refresh the screen to choose the board to post this status to.', 'wp-to-buffer' ); |
| 20 |
?> |
| 21 |
<a href="<?php echo esc_attr( $this->base->plugin->documentation_url ); ?>/status-settings/#buffer-pinterest" target="_blank"> |
| 22 |
<?php echo esc_html_e( 'Click here for instructions on creating a Pinterest board.', 'wp-to-buffer' ); ?> |
| 23 |
</a> |
| 24 |
</p> |
| 25 |
</div> |
| 26 |
|
| 27 |
<!-- Status Type and Text --> |
| 28 |
<div class="wpzinc-option status"> |
| 29 |
<div class="full"> |
| 30 |
<h3><?php esc_html_e( 'Status Type and Text', 'wp-to-buffer' ); ?></h3> |
| 31 |
<p class="description"> |
| 32 |
<?php esc_html_e( 'The type of status to create and its text.', 'wp-to-buffer' ); ?> |
| 33 |
</p> |
| 34 |
|
| 35 |
<select name="<?php echo esc_attr( $this->base->plugin->name ); ?>_post_type" class="post_type" size="1"> |
| 36 |
<?php |
| 37 |
foreach ( $this->base->get_class( 'common' )->get_status_post_type_options() as $status_post_type_key => $status_post_type_label ) { |
| 38 |
?> |
| 39 |
<option value="<?php echo esc_attr( $status_post_type_key ); ?>"> |
| 40 |
<?php echo esc_attr( $status_post_type_label ); ?> |
| 41 |
</option> |
| 42 |
<?php |
| 43 |
} |
| 44 |
?> |
| 45 |
</select> |
| 46 |
|
| 47 |
<?php |
| 48 |
// Tags. |
| 49 |
$textarea = 'textarea.message'; |
| 50 |
require 'settings-post-action-status-tags.php'; |
| 51 |
?> |
| 52 |
|
| 53 |
<textarea name="<?php echo esc_attr( $this->base->plugin->name ); ?>_message" rows="3" class="widefat wpzinc-autosize-js message"></textarea> |
| 54 |
|
| 55 |
<?php |
| 56 |
// If we're editing a Post, Page or CPT, show the chararcter count. |
| 57 |
if ( isset( $post ) && ! empty( $post ) ) { |
| 58 |
?> |
| 59 |
<small class="characters"> |
| 60 |
<span class="character-count"></span> |
| 61 |
<?php esc_html_e( 'characters', 'wp-to-buffer' ); ?> |
| 62 |
</small> |
| 63 |
<?php |
| 64 |
} |
| 65 |
?> |
| 66 |
</div> |
| 67 |
</div> |
| 68 |
|
| 69 |
<!-- Schedule --> |
| 70 |
<div class="wpzinc-option status"> |
| 71 |
<div class="full"> |
| 72 |
<h3><?php esc_html_e( 'Schedule', 'wp-to-buffer' ); ?></h3> |
| 73 |
<p class="description"> |
| 74 |
<?php esc_html_e( 'When the status should be added to social media.', 'wp-to-buffer' ); ?> |
| 75 |
</p> |
| 76 |
|
| 77 |
<select name="<?php echo esc_attr( $this->base->plugin->name ); ?>_schedule" size="1" class="schedule widefat"> |
| 78 |
<?php |
| 79 |
foreach ( $this->base->get_class( 'common' )->get_schedule_options( $post_type, $is_post_screen ) as $schedule_option => $label ) { |
| 80 |
?> |
| 81 |
<option value="<?php echo esc_attr( $schedule_option ); ?>"><?php echo esc_attr( $label ); ?></option> |
| 82 |
<?php |
| 83 |
} |
| 84 |
?> |
| 85 |
</select> |
| 86 |
</div> |
| 87 |
</div> |
| 88 |
|
| 89 |
<!-- Link --> |
| 90 |
<div class="wpzinc-option link"> |
| 91 |
<div class="full"> |
| 92 |
<h3><?php esc_html_e( 'Link', 'wp-to-buffer' ); ?></h3> |
| 93 |
<p class="description"> |
| 94 |
<?php esc_html_e( 'The "primary" URL to use for the link preview / card. Additional links can be included in the status text above.', 'wp-to-buffer' ); ?> |
| 95 |
</p> |
| 96 |
|
| 97 |
<input type="text" name="<?php echo esc_attr( $this->base->plugin->name ); ?>_url" class="widefat url" /> |
| 98 |
</div> |
| 99 |
</div> |
| 100 |
|
| 101 |
<!-- Pinterest --> |
| 102 |
<div class="wpzinc-option pinterest hidden"> |
| 103 |
<div class="full"> |
| 104 |
<h3><?php esc_html_e( 'Pinterest', 'wp-to-buffer' ); ?></h3> |
| 105 |
<p class="description"> |
| 106 |
<?php |
| 107 |
esc_html_e( 'Define the Pinterest Board for this status to be sent to.', 'wp-to-buffer' ); |
| 108 |
?> |
| 109 |
</p> |
| 110 |
|
| 111 |
<table class="widefat fixed striped"> |
| 112 |
<tbody> |
| 113 |
<tr> |
| 114 |
<td width="20%"> |
| 115 |
<label for="<?php echo esc_attr( $this->base->plugin->name ); ?>_pinterest_board"> |
| 116 |
<?php esc_html_e( 'Board', 'wp-to-buffer' ); ?> |
| 117 |
</label> |
| 118 |
</td> |
| 119 |
<td> |
| 120 |
<!-- Pinterest: Sub Profile --> |
| 121 |
<select name="<?php echo esc_attr( $this->base->plugin->name ); ?>_pinterest[board]" id="<?php echo esc_attr( $this->base->plugin->name ); ?>_pinterest_board" size="1" class="widefat"></select> |
| 122 |
<input type="url" name="<?php echo esc_attr( $this->base->plugin->name ); ?>_pinterest[board]" id="<?php echo esc_attr( $this->base->plugin->name ); ?>_pinterest_board" placeholder="<?php esc_attr_e( 'Pinterest Board URL', 'wp-to-buffer' ); ?>" class="widefat" /> |
| 123 |
</td> |
| 124 |
</tr> |
| 125 |
|
| 126 |
<?php |
| 127 |
if ( $this->base->supports( 'pinterest_title' ) ) { |
| 128 |
?> |
| 129 |
<tr> |
| 130 |
<td> |
| 131 |
<label for="pinterest_title"> |
| 132 |
<?php esc_html_e( 'Pin Title', 'wp-to-buffer' ); ?> |
| 133 |
</label> |
| 134 |
</td> |
| 135 |
<td> |
| 136 |
<input type="text" name="<?php echo esc_attr( $this->base->plugin->name ); ?>_pinterest[title]" id="pinterest_title" placeholder="<?php esc_attr_e( 'Pin Title', 'wp-to-buffer' ); ?>" class="widefat" /> |
| 137 |
<p class="description"> |
| 138 |
<?php esc_html_e( 'An optional title. Text Tags are supported.', 'wp-to-buffer' ); ?> |
| 139 |
</p> |
| 140 |
</td> |
| 141 |
</tr> |
| 142 |
<?php |
| 143 |
} |
| 144 |
?> |
| 145 |
</tbody> |
| 146 |
</table> |
| 147 |
</div> |
| 148 |
</div> |
| 149 |
|
| 150 |
<?php |
| 151 |
if ( $this->base->supports( 'googlebusiness' ) ) { |
| 152 |
?> |
| 153 |
<!-- Google Business Profile --> |
| 154 |
<div class="wpzinc-option googlebusiness hidden"> |
| 155 |
<div class="full"> |
| 156 |
<h3><?php esc_html_e( 'Google Business Profile', 'wp-to-buffer' ); ?></h3> |
| 157 |
<p class="description"> |
| 158 |
<?php |
| 159 |
echo esc_html_e( 'Optional: Define the status type (What\'s New, Offer or Event) and additional structured fields / data.', 'wp-to-buffer' ); |
| 160 |
?> |
| 161 |
</p> |
| 162 |
|
| 163 |
<table class="widefat fixed striped"> |
| 164 |
<tbody> |
| 165 |
<tr> |
| 166 |
<td width="20%"> |
| 167 |
<label for="googlebusiness_post_type"> |
| 168 |
<?php esc_html_e( 'Post Type', 'wp-to-buffer' ); ?> |
| 169 |
</label> |
| 170 |
</td> |
| 171 |
<td> |
| 172 |
<select name="<?php echo esc_attr( $this->base->plugin->name ); ?>_googlebusiness[post_type]" id="googlebusiness_post_type" size="1" class="widefat"> |
| 173 |
<option value="whats_new"><?php esc_attr_e( 'What\'s New', 'wp-to-buffer' ); ?></option> |
| 174 |
<option value="offer"><?php esc_attr_e( 'Offer', 'wp-to-buffer' ); ?></option> |
| 175 |
<option value="event"><?php esc_attr_e( 'Event', 'wp-to-buffer' ); ?></option> |
| 176 |
</select> |
| 177 |
</td> |
| 178 |
</tr> |
| 179 |
<tr class="whats_new event"> |
| 180 |
<td> |
| 181 |
<label for="googlebusiness_cta"> |
| 182 |
<?php esc_html_e( 'Call to Action', 'wp-to-buffer' ); ?> |
| 183 |
</label> |
| 184 |
</td> |
| 185 |
<td> |
| 186 |
<select name="<?php echo esc_attr( $this->base->plugin->name ); ?>_googlebusiness[cta]" id="googlebusiness_cta" size="1" class="widefat"> |
| 187 |
<option value="book"><?php esc_attr_e( 'Book', 'wp-to-buffer' ); ?></option> |
| 188 |
<option value="order"><?php esc_attr_e( 'Order', 'wp-to-buffer' ); ?></option> |
| 189 |
<option value="shop"><?php esc_attr_e( 'Shop', 'wp-to-buffer' ); ?></option> |
| 190 |
<option value="learn_more"><?php esc_attr_e( 'Learn More', 'wp-to-buffer' ); ?></option> |
| 191 |
<option value="signup"><?php esc_attr_e( 'Sign Up', 'wp-to-buffer' ); ?></option> |
| 192 |
</select> |
| 193 |
</td> |
| 194 |
</tr> |
| 195 |
<tr class="offer event"> |
| 196 |
<td> |
| 197 |
<label for="googlebusiness_start_date_option"> |
| 198 |
<?php esc_html_e( 'Start Date', 'wp-to-buffer' ); ?> |
| 199 |
</label> |
| 200 |
</td> |
| 201 |
<td> |
| 202 |
<select name="<?php echo esc_attr( $this->base->plugin->name ); ?>_googlebusiness[start_date_option]" id="googlebusiness_start_date_option" size="1" class="widefat"> |
| 203 |
<?php |
| 204 |
foreach ( $this->base->get_class( 'common' )->get_google_business_start_date_options( $post_type ) as $schedule_option => $label ) { |
| 205 |
?> |
| 206 |
<option value="<?php echo esc_attr( $schedule_option ); ?>"><?php echo esc_attr( $label ); ?></option> |
| 207 |
<?php |
| 208 |
} |
| 209 |
?> |
| 210 |
</select> |
| 211 |
|
| 212 |
<input type="text" name="<?php echo esc_attr( $this->base->plugin->name ); ?>_googlebusiness[start_date]" id="googlebusiness_start_date" placeholder="<?php esc_attr_e( 'Custom Meta Field Name', 'wp-to-buffer' ); ?>" /> |
| 213 |
</td> |
| 214 |
</tr> |
| 215 |
<tr class="offer event"> |
| 216 |
<td> |
| 217 |
<label for="googlebusiness_end_date_option"> |
| 218 |
<?php esc_html_e( 'End Date', 'wp-to-buffer' ); ?> |
| 219 |
</label> |
| 220 |
</td> |
| 221 |
<td> |
| 222 |
<select name="<?php echo esc_attr( $this->base->plugin->name ); ?>_googlebusiness[end_date_option]" id="googlebusiness_end_date_option" size="1" class="widefat"> |
| 223 |
<?php |
| 224 |
foreach ( $this->base->get_class( 'common' )->get_google_business_end_date_options( $post_type ) as $schedule_option => $label ) { |
| 225 |
?> |
| 226 |
<option value="<?php echo esc_attr( $schedule_option ); ?>"><?php echo esc_attr( $label ); ?></option> |
| 227 |
<?php |
| 228 |
} |
| 229 |
?> |
| 230 |
</select> |
| 231 |
|
| 232 |
<input type="text" name="<?php echo esc_attr( $this->base->plugin->name ); ?>_googlebusiness[end_date]" id="googlebusiness_end_date" placeholder="<?php esc_attr_e( 'Custom Meta Field Name', 'wp-to-buffer' ); ?>" /> |
| 233 |
</td> |
| 234 |
</tr> |
| 235 |
<tr class="offer event"> |
| 236 |
<td> |
| 237 |
<label for="googlebusiness_title"> |
| 238 |
<?php esc_html_e( 'Event / Offer Title', 'wp-to-buffer' ); ?> |
| 239 |
</label> |
| 240 |
</td> |
| 241 |
<td> |
| 242 |
<input type="text" name="<?php echo esc_attr( $this->base->plugin->name ); ?>_googlebusiness[title]" id="googlebusiness_title" class="widefat" /> |
| 243 |
</td> |
| 244 |
</tr> |
| 245 |
<tr class="offer"> |
| 246 |
<td> |
| 247 |
<label for="googlebusiness_code"> |
| 248 |
<?php esc_html_e( 'Coupon Code', 'wp-to-buffer' ); ?> |
| 249 |
</label> |
| 250 |
</td> |
| 251 |
<td> |
| 252 |
<input type="text" name="<?php echo esc_attr( $this->base->plugin->name ); ?>_googlebusiness[code]" id="googlebusiness_code" class="widefat" /> |
| 253 |
</td> |
| 254 |
</tr> |
| 255 |
<tr class="offer"> |
| 256 |
<td> |
| 257 |
<label for="googlebusiness_terms"> |
| 258 |
<?php esc_html_e( 'Terms and Conditions Text', 'wp-to-buffer' ); ?> |
| 259 |
</label> |
| 260 |
</td> |
| 261 |
<td> |
| 262 |
<input type="text" name="<?php echo esc_attr( $this->base->plugin->name ); ?>_googlebusiness[terms]" id="googlebusiness_terms" class="widefat" /> |
| 263 |
</td> |
| 264 |
</tr> |
| 265 |
</tbody> |
| 266 |
</table> |
| 267 |
</div> |
| 268 |
</div> |
| 269 |
<?php |
| 270 |
} |
| 271 |
?> |
| 272 |
|
| 273 |
<!-- Images --> |
| 274 |
<div class="wpzinc-option images"> |
| 275 |
<div class="full"> |
| 276 |
<h3><?php esc_html_e( 'Image', 'wp-to-buffer' ); ?></h3> |
| 277 |
<p class="description"> |
| 278 |
<?php esc_html_e( 'The type of image to use.', 'wp-to-buffer' ); ?> |
| 279 |
</p> |
| 280 |
|
| 281 |
<table class="widefat fixed striped"> |
| 282 |
<tbody> |
| 283 |
<tr> |
| 284 |
<td width="20%"> |
| 285 |
<label for="<?php echo esc_attr( $this->base->plugin->name ); ?>_image"> |
| 286 |
<?php esc_html_e( 'Image', 'wp-to-buffer' ); ?> |
| 287 |
</label> |
| 288 |
</td> |
| 289 |
<td> |
| 290 |
<select id="<?php echo esc_attr( $this->base->plugin->name ); ?>_image" name="<?php echo esc_attr( $this->base->plugin->name ); ?>_image" size="1" class="image"> |
| 291 |
<?php |
| 292 |
foreach ( $this->base->get_class( 'image' )->get_status_image_options( false, $post_type ) as $value => $image_option ) { |
| 293 |
?> |
| 294 |
<option value="<?php echo esc_attr( $value ); ?>"><?php echo esc_attr( $image_option['label'] ); ?></option> |
| 295 |
<?php |
| 296 |
} |
| 297 |
?> |
| 298 |
</select> |
| 299 |
</td> |
| 300 |
</tr> |
| 301 |
</tbody> |
| 302 |
</table> |
| 303 |
</div> |
| 304 |
</div> |
| 305 |
</div> |
| 306 |
</div> |
| 307 |
|