alignment.php
4 years ago
devices.php
4 years ago
settings.php
4 years ago
state.php
4 years ago
upsell.php
4 years ago
visibility.php
4 years ago
alignment.php
72 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Alignment Widget Options |
| 4 | * |
| 5 | * @copyright Copyright (c) 2015, Jeffrey Carandang |
| 6 | * @since 1.0 |
| 7 | */ |
| 8 | |
| 9 | // Exit if accessed directly |
| 10 | if ( ! defined( 'ABSPATH' ) ) exit; |
| 11 | |
| 12 | /** |
| 13 | * Add Alignment Widget Options Tab |
| 14 | * |
| 15 | * @since 1.0 |
| 16 | * @return void |
| 17 | */ |
| 18 | |
| 19 | /** |
| 20 | * Called on 'extended_widget_opts_tabs' |
| 21 | * create new tab navigation for alignment options |
| 22 | */ |
| 23 | function widgetopts_tab_alignment( $args ){ ?> |
| 24 | <li class="extended-widget-opts-tab-alignment"> |
| 25 | <a href="#extended-widget-opts-tab-<?php echo $args['id'];?>-alignment" title="<?php _e( 'Alignment', 'widget-options' );?>" ><span class="dashicons dashicons-editor-aligncenter"></span> <span class="tabtitle"><?php _e( 'Alignment', 'widget-options' );?></span></a> |
| 26 | </li> |
| 27 | <?php |
| 28 | } |
| 29 | add_action( 'extended_widget_opts_tabs', 'widgetopts_tab_alignment' ); |
| 30 | |
| 31 | /** |
| 32 | * Called on 'extended_widget_opts_tabcontent' |
| 33 | * create new tab content options for alignment options |
| 34 | */ |
| 35 | function widgetopts_tabcontent_alignment( $args ){ |
| 36 | $desktop = ''; |
| 37 | if( isset( $args['params'] ) && isset( $args['params']['alignment'] ) ){ |
| 38 | if( isset( $args['params']['alignment']['desktop'] ) ){ |
| 39 | $desktop = $args['params']['alignment']['desktop']; |
| 40 | } |
| 41 | } |
| 42 | $upgrade_link = apply_filters('widget_options_site_url', trailingslashit(WIDGETOPTS_PLUGIN_WEBSITE)); |
| 43 | ?> |
| 44 | <div id="extended-widget-opts-tab-<?php echo $args['id'];?>-alignment" class="extended-widget-opts-tabcontent extended-widget-opts-tabcontent-alignment"> |
| 45 | <table class="form-table"> |
| 46 | <tbody> |
| 47 | <tr valign="top"> |
| 48 | <td scope="row"><strong><?php _e( 'Devices', 'widget-options' );?></strong></td> |
| 49 | <td><strong><?php _e( 'Alignment', 'widget-options' );?></strong></td> |
| 50 | </tr> |
| 51 | <tr valign="top"> |
| 52 | <td scope="row"><span class="dashicons dashicons-desktop"></span> <?php _e( 'All Devices', 'widget-options' );?></td> |
| 53 | <td> |
| 54 | <select class="widefat" name="<?php echo $args['namespace'];?>[extended_widget_opts][alignment][desktop]"> |
| 55 | <option value="default"><?php _e( 'Default', 'widget-options' );?></option> |
| 56 | <option value="center" <?php if( $desktop == 'center' ){ echo 'selected="selected"'; }?> ><?php _e( 'Center', 'widget-options' );?></option> |
| 57 | <option value="left" <?php if( $desktop == 'left' ){ echo 'selected="selected"'; }?>><?php _e( 'Left', 'widget-options' );?></option> |
| 58 | <option value="right" <?php if( $desktop == 'right' ){ echo 'selected="selected"'; }?>><?php _e( 'Right', 'widget-options' );?></option> |
| 59 | <option value="justify" <?php if( $desktop == 'justify' ){ echo 'selected="selected"'; }?>><?php _e( 'Justify', 'widget-options' );?></option> |
| 60 | </select> |
| 61 | </td> |
| 62 | </tr> |
| 63 | <tr valign="top" class="widgetopts-topro"> |
| 64 | <td colspan="2"><small><?php _e( '<em>Upgrade to <a href="'.$upgrade_link.'" target="_blank">Pro Version</a> for Multiple Devices Alignment and Additional Widget Options.</em>', 'widget-options' );?></small></td> |
| 65 | </tr> |
| 66 | </tbody> |
| 67 | </table> |
| 68 | </div> |
| 69 | <?php |
| 70 | } |
| 71 | add_action( 'extended_widget_opts_tabcontent', 'widgetopts_tabcontent_alignment'); ?> |
| 72 |