@@ -12,7 +12,9 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | 14 | // Exit if accessed directly |
| 15 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
| 15 | +if ( ! defined( 'ABSPATH' ) ) { |
|
| 16 | + exit; |
|
| 17 | +} |
|
| 16 | 18 | |
| 17 | 19 | /** |
| 18 | 20 | * GravityView_Welcome Class |
@@ -34,10 +34,10 @@ discard block |
||
| 34 | 34 | * @since 1.0 |
| 35 | 35 | */ |
| 36 | 36 | public function __construct() { |
| 37 | - add_action( 'admin_menu', array( $this, 'admin_menus'), 200 ); |
|
| 37 | + add_action( 'admin_menu', array( $this, 'admin_menus' ), 200 ); |
|
| 38 | 38 | add_action( 'admin_head', array( $this, 'admin_head' ) ); |
| 39 | - add_action( 'admin_init', array( $this, 'welcome' ) ); |
|
| 40 | - add_filter( 'gravityview_is_admin_page', array( $this, 'is_dashboard_page'), 10, 2 ); |
|
| 39 | + add_action( 'admin_init', array( $this, 'welcome' ) ); |
|
| 40 | + add_filter( 'gravityview_is_admin_page', array( $this, 'is_dashboard_page' ), 10, 2 ); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | /** |
@@ -53,8 +53,8 @@ discard block |
||
| 53 | 53 | // Add help page to GravityView menu |
| 54 | 54 | add_submenu_page( |
| 55 | 55 | 'edit.php?post_type=gravityview', |
| 56 | - __('GravityView: Getting Started', 'gravityview'), |
|
| 57 | - __('Getting Started', 'gravityview'), |
|
| 56 | + __( 'GravityView: Getting Started', 'gravityview' ), |
|
| 57 | + __( 'Getting Started', 'gravityview' ), |
|
| 58 | 58 | $this->minimum_capability, |
| 59 | 59 | 'gv-getting-started', |
| 60 | 60 | array( $this, 'getting_started_screen' ) |
@@ -87,10 +87,10 @@ discard block |
||
| 87 | 87 | * |
| 88 | 88 | * @return boolean $is_page True: yep; false: nope |
| 89 | 89 | */ |
| 90 | - public function is_dashboard_page($is_page = false, $hook = NULL) { |
|
| 90 | + public function is_dashboard_page( $is_page = false, $hook = NULL ) { |
|
| 91 | 91 | global $plugin_page; |
| 92 | 92 | |
| 93 | - if($is_page) { return $is_page; } |
|
| 93 | + if ( $is_page ) { return $is_page; } |
|
| 94 | 94 | |
| 95 | 95 | return in_array( $plugin_page, array( 'gv-about', 'gv-credits', 'gv-getting-started' ) ); |
| 96 | 96 | } |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | remove_submenu_page( 'edit.php?post_type=gravityview', 'gv-credits' ); |
| 109 | 109 | remove_submenu_page( 'edit.php?post_type=gravityview', 'gv-changelog' ); |
| 110 | 110 | |
| 111 | - if( !$this->is_dashboard_page() ) { return; } |
|
| 111 | + if ( ! $this->is_dashboard_page() ) { return; } |
|
| 112 | 112 | |
| 113 | 113 | ?> |
| 114 | 114 | <style type="text/css" media="screen"> |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | // Don't fetch -beta, etc. |
| 142 | 142 | list( $display_version ) = explode( '-', GravityView_Plugin::version ); |
| 143 | 143 | |
| 144 | - $selected = !empty( $plugin_page ) ? $plugin_page : 'gv-getting-started'; |
|
| 144 | + $selected = ! empty( $plugin_page ) ? $plugin_page : 'gv-getting-started'; |
|
| 145 | 145 | |
| 146 | 146 | echo gravityview_get_floaty( 132 ); |
| 147 | 147 | ?> |
@@ -150,13 +150,13 @@ discard block |
||
| 150 | 150 | <div class="about-text"><?php esc_html_e( 'Thank you for installing GravityView. Beautifully display your Gravity Forms entries.', 'gravityview' ); ?></div> |
| 151 | 151 | |
| 152 | 152 | <h2 class="nav-tab-wrapper clear"> |
| 153 | - <a class="nav-tab <?php echo $selected == 'gv-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-getting-started', 'post_type' => 'gravityview'), 'edit.php' ) ) ); ?>"> |
|
| 153 | + <a class="nav-tab <?php echo $selected == 'gv-getting-started' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-getting-started', 'post_type' => 'gravityview' ), 'edit.php' ) ) ); ?>"> |
|
| 154 | 154 | <?php _e( "Getting Started", 'gravityview' ); ?> |
| 155 | 155 | </a> |
| 156 | - <a class="nav-tab <?php echo $selected == 'gv-changelog' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-changelog', 'post_type' => 'gravityview'), 'edit.php' ) ) ); ?>"> |
|
| 156 | + <a class="nav-tab <?php echo $selected == 'gv-changelog' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-changelog', 'post_type' => 'gravityview' ), 'edit.php' ) ) ); ?>"> |
|
| 157 | 157 | <?php _e( "List of Changes", 'gravityview' ); ?> |
| 158 | 158 | </a> |
| 159 | - <a class="nav-tab <?php echo $selected == 'gv-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-credits', 'post_type' => 'gravityview'), 'edit.php' ) ) ); ?>"> |
|
| 159 | + <a class="nav-tab <?php echo $selected == 'gv-credits' ? 'nav-tab-active' : ''; ?>" href="<?php echo esc_url( admin_url( add_query_arg( array( 'page' => 'gv-credits', 'post_type' => 'gravityview' ), 'edit.php' ) ) ); ?>"> |
|
| 160 | 160 | <?php _e( 'Credits', 'gravityview' ); ?> |
| 161 | 161 | </a> |
| 162 | 162 | </h2> |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | <h2>Create a View</h2> |
| 193 | 193 | |
| 194 | 194 | <ol class="ol-decimal"> |
| 195 | - <li>Go to <a href="<?php echo admin_url('post-new.php?post_type=gravityview'); ?>">Views > New View</a></li> |
|
| 195 | + <li>Go to <a href="<?php echo admin_url( 'post-new.php?post_type=gravityview' ); ?>">Views > New View</a></li> |
|
| 196 | 196 | <li>If you want to <strong>create a new form</strong>, click the "Use a Form Preset" button</li> |
| 197 | 197 | <li>If you want to <strong>use an existing form’s entries</strong>, select from the dropdown.</li> |
| 198 | 198 | <li>Select the type of View you would like to create. There are two core types of Views: <strong>Table</strong> and <strong>Listing</strong>. |
@@ -765,7 +765,7 @@ discard block |
||
| 765 | 765 | </ul> |
| 766 | 766 | |
| 767 | 767 | <h4><?php esc_attr_e( 'Want to contribute?', 'gravityview' ); ?></h4> |
| 768 | - <p><?php echo sprintf( esc_attr__( 'If you want to contribute to the code, %syou can on Github%s. If your contributions are accepted, you will be thanked here.', 'gravityview'), '<a href="https://github.com/katzwebservices/GravityView">', '</a>' ); ?></p> |
|
| 768 | + <p><?php echo sprintf( esc_attr__( 'If you want to contribute to the code, %syou can on Github%s. If your contributions are accepted, you will be thanked here.', 'gravityview' ), '<a href="https://github.com/katzwebservices/GravityView">', '</a>' ); ?></p> |
|
| 769 | 769 | </div> |
| 770 | 770 | </div> |
| 771 | 771 | |
@@ -808,7 +808,7 @@ discard block |
||
| 808 | 808 | global $plugin_page; |
| 809 | 809 | |
| 810 | 810 | // Bail if we're just editing the plugin |
| 811 | - if( $plugin_page === 'plugin-editor.php' ) { return; } |
|
| 811 | + if ( $plugin_page === 'plugin-editor.php' ) { return; } |
|
| 812 | 812 | |
| 813 | 813 | // Bail if no activation redirect |
| 814 | 814 | if ( ! get_transient( '_gv_activation_redirect' ) ) { return; } |
@@ -819,7 +819,7 @@ discard block |
||
| 819 | 819 | $upgrade = get_option( 'gv_version_upgraded_from' ); |
| 820 | 820 | |
| 821 | 821 | // Don't do anything if they've already seen the new version info |
| 822 | - if( $upgrade === GravityView_Plugin::version ) { |
|
| 822 | + if ( $upgrade === GravityView_Plugin::version ) { |
|
| 823 | 823 | return; |
| 824 | 824 | } |
| 825 | 825 | |
@@ -827,10 +827,10 @@ discard block |
||
| 827 | 827 | update_option( 'gv_version_upgraded_from', GravityView_Plugin::version ); |
| 828 | 828 | |
| 829 | 829 | // Bail if activating from network, or bulk |
| 830 | - if ( is_network_admin() || isset( $_GET['activate-multi'] ) ) { return; } |
|
| 830 | + if ( is_network_admin() || isset( $_GET[ 'activate-multi' ] ) ) { return; } |
|
| 831 | 831 | |
| 832 | 832 | // First time install |
| 833 | - if( ! $upgrade ) { |
|
| 833 | + if ( ! $upgrade ) { |
|
| 834 | 834 | wp_safe_redirect( admin_url( 'edit.php?post_type=gravityview&page=gv-getting-started' ) ); exit; |
| 835 | 835 | } |
| 836 | 836 | // Update |
@@ -2,8 +2,9 @@ discard block |
||
| 2 | 2 | namespace GV; |
| 3 | 3 | |
| 4 | 4 | /** If this file is called directly, abort. */ |
| 5 | -if ( ! defined( 'GRAVITYVIEW_DIR' ) ) |
|
| 5 | +if ( ! defined( 'GRAVITYVIEW_DIR' ) ) { |
|
| 6 | 6 | die(); |
| 7 | +} |
|
| 7 | 8 | |
| 8 | 9 | /** |
| 9 | 10 | * The base Entry class. |
@@ -24,8 +25,9 @@ discard block |
||
| 24 | 25 | $endpoint = self::get_endpoint_name(); |
| 25 | 26 | |
| 26 | 27 | /** Let's make sure the endpoint array is not polluted. */ |
| 27 | - if ( in_array( array( EP_ALL, $endpoint, $endpoint ), $wp_rewrite->endpoints ) ) |
|
| 28 | - return; |
|
| 28 | + if ( in_array( array( EP_ALL, $endpoint, $endpoint ), $wp_rewrite->endpoints ) ) { |
|
| 29 | + return; |
|
| 30 | + } |
|
| 29 | 31 | |
| 30 | 32 | add_rewrite_endpoint( $endpoint, EP_ALL ); |
| 31 | 33 | } |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | $supports = array( 'title', 'revisions' ); |
| 36 | 36 | |
| 37 | 37 | if ( $is_hierarchical ) { |
| 38 | - $supports[] = 'page-attributes'; |
|
| 38 | + $supports[ ] = 'page-attributes'; |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /** |
@@ -2,8 +2,9 @@ discard block |
||
| 2 | 2 | namespace GV; |
| 3 | 3 | |
| 4 | 4 | /** If this file is called directly, abort. */ |
| 5 | -if ( ! defined( 'GRAVITYVIEW_DIR' ) ) |
|
| 5 | +if ( ! defined( 'GRAVITYVIEW_DIR' ) ) { |
|
| 6 | 6 | die(); |
| 7 | +} |
|
| 7 | 8 | |
| 8 | 9 | /** |
| 9 | 10 | * The default GravityView View class. |
@@ -21,8 +22,9 @@ discard block |
||
| 21 | 22 | public static function register_post_type() { |
| 22 | 23 | |
| 23 | 24 | /** Register only once */ |
| 24 | - if ( post_type_exists( 'gravityview' ) ) |
|
| 25 | - return; |
|
| 25 | + if ( post_type_exists( 'gravityview' ) ) { |
|
| 26 | + return; |
|
| 27 | + } |
|
| 26 | 28 | |
| 27 | 29 | /** |
| 28 | 30 | * @filter `gravityview_is_hierarchical` Make GravityView Views hierarchical by returning TRUE |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | |
| 15 | 15 | var $is_numeric = true; |
| 16 | 16 | |
| 17 | - var $search_operators = array( 'is', 'isnot', 'starts_with', 'ends_with' ); |
|
| 17 | + var $search_operators = array( 'is', 'isnot', 'starts_with', 'ends_with' ); |
|
| 18 | 18 | |
| 19 | 19 | var $group = 'pricing'; |
| 20 | 20 | |
@@ -45,9 +45,9 @@ discard block |
||
| 45 | 45 | $field_options = parent::field_options( $field_options, $template_id, $field_id, $context, $input_type ); |
| 46 | 46 | |
| 47 | 47 | // It's not the parent field; it's an input |
| 48 | - if( floor( $field_id ) !== floatval( $field_id ) ) { |
|
| 48 | + if ( floor( $field_id ) !== floatval( $field_id ) ) { |
|
| 49 | 49 | |
| 50 | - if( $this->is_choice_value_enabled() ) { |
|
| 50 | + if ( $this->is_choice_value_enabled() ) { |
|
| 51 | 51 | |
| 52 | 52 | $desc = esc_html__( 'This input has a label and a value. What should be displayed?', 'gravityview' ); |
| 53 | 53 | $default = 'value'; |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | ); |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | - $field_options['choice_display'] = array( |
|
| 68 | + $field_options[ 'choice_display' ] = array( |
|
| 69 | 69 | 'type' => 'radio', |
| 70 | 70 | 'class' => 'vertical', |
| 71 | 71 | 'label' => __( 'What should be displayed:', 'gravityview' ), |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | function clear_product_info_cache( $form = array(), $entry_id = 0, $Edit_Entry_Render = null ) { |
| 51 | 51 | |
| 52 | - if( $this->should_hide_product_fields( $Edit_Entry_Render->entry ) ) { |
|
| 52 | + if ( $this->should_hide_product_fields( $Edit_Entry_Render->entry ) ) { |
|
| 53 | 53 | return; |
| 54 | 54 | } |
| 55 | 55 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | * @see GVCommon::entry_has_transaction_data() |
| 102 | 102 | * @param boolean $hide_product_fields Whether to hide product fields in the editor. Uses $entry data to determine. |
| 103 | 103 | */ |
| 104 | - $hide_product_fields = (bool) apply_filters( 'gravityview/edit_entry/hide-product-fields', $has_transaction_data ); |
|
| 104 | + $hide_product_fields = (bool)apply_filters( 'gravityview/edit_entry/hide-product-fields', $has_transaction_data ); |
|
| 105 | 105 | |
| 106 | 106 | return $hide_product_fields; |
| 107 | 107 | } |
@@ -2,8 +2,9 @@ |
||
| 2 | 2 | namespace GV; |
| 3 | 3 | |
| 4 | 4 | /** If this file is called directly, abort. */ |
| 5 | -if ( ! defined( 'GRAVITYVIEW_DIR' ) ) |
|
| 5 | +if ( ! defined( 'GRAVITYVIEW_DIR' ) ) { |
|
| 6 | 6 | die(); |
| 7 | +} |
|
| 7 | 8 | |
| 8 | 9 | /** |
| 9 | 10 | * The Request abstract class. |
@@ -2,8 +2,9 @@ |
||
| 2 | 2 | namespace GV; |
| 3 | 3 | |
| 4 | 4 | /** If this file is called directly, abort. */ |
| 5 | -if ( ! defined( 'GRAVITYVIEW_DIR' ) ) |
|
| 5 | +if ( ! defined( 'GRAVITYVIEW_DIR' ) ) { |
|
| 6 | 6 | die(); |
| 7 | +} |
|
| 7 | 8 | |
| 8 | 9 | /** |
| 9 | 10 | * The base \GV\Shortcode class. |
@@ -56,15 +56,15 @@ discard block |
||
| 56 | 56 | public static function add() { |
| 57 | 57 | $shortcode = new static(); |
| 58 | 58 | if ( shortcode_exists( $shortcode->name ) ) { |
| 59 | - if ( empty( self::$shortcodes[$shortcode->name] ) ) { |
|
| 59 | + if ( empty( self::$shortcodes[ $shortcode->name ] ) ) { |
|
| 60 | 60 | throw new \ErrorException( sprintf( 'Shortcode [%s] has already been registered elsewhere.', $shortcode->name ) ); |
| 61 | 61 | } |
| 62 | 62 | } else { |
| 63 | 63 | add_shortcode( $shortcode->name, array( get_class( $shortcode ), 'callback' ) ); |
| 64 | - self::$shortcodes[$shortcode->name] = $shortcode; |
|
| 64 | + self::$shortcodes[ $shortcode->name ] = $shortcode; |
|
| 65 | 65 | } |
| 66 | 66 | |
| 67 | - return self::$shortcodes[$shortcode->name]; |
|
| 67 | + return self::$shortcodes[ $shortcode->name ]; |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /** |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | public static function remove() { |
| 78 | 78 | $shortcode = new static(); |
| 79 | - unset( self::$shortcodes[$shortcode->name] ); |
|
| 79 | + unset( self::$shortcodes[ $shortcode->name ] ); |
|
| 80 | 80 | remove_shortcode( $shortcode->name ); |
| 81 | 81 | } |
| 82 | 82 | |
@@ -108,14 +108,14 @@ discard block |
||
| 108 | 108 | preg_match_all( '/' . get_shortcode_regex() . '/', $content, $matches, PREG_SET_ORDER ); |
| 109 | 109 | |
| 110 | 110 | foreach ( $matches as $shortcode ) { |
| 111 | - $shortcode_name = $shortcode[2]; |
|
| 111 | + $shortcode_name = $shortcode[ 2 ]; |
|
| 112 | 112 | |
| 113 | - $shortcode_atts = shortcode_parse_atts( $shortcode[3] ); |
|
| 114 | - $shortcode_content = $shortcode[5]; |
|
| 113 | + $shortcode_atts = shortcode_parse_atts( $shortcode[ 3 ] ); |
|
| 114 | + $shortcode_content = $shortcode[ 5 ]; |
|
| 115 | 115 | |
| 116 | 116 | /** This is a registered GravityView shortcode. */ |
| 117 | - if ( !empty( self::$shortcodes[$shortcode_name] ) ) { |
|
| 118 | - $shortcode = clone( self::$shortcodes[$shortcode_name] ); |
|
| 117 | + if ( ! empty( self::$shortcodes[ $shortcode_name ] ) ) { |
|
| 118 | + $shortcode = clone( self::$shortcodes[ $shortcode_name ] ); |
|
| 119 | 119 | } else { |
| 120 | 120 | /** This is some generic shortcode. */ |
| 121 | 121 | $shortcode = new self; |
@@ -2,8 +2,9 @@ |
||
| 2 | 2 | namespace GV\Shortcodes; |
| 3 | 3 | |
| 4 | 4 | /** If this file is called directly, abort. */ |
| 5 | -if ( ! defined( 'GRAVITYVIEW_DIR' ) ) |
|
| 5 | +if ( ! defined( 'GRAVITYVIEW_DIR' ) ) { |
|
| 6 | 6 | die(); |
| 7 | +} |
|
| 7 | 8 | |
| 8 | 9 | /** |
| 9 | 10 | * The base \GV\Shortcode class. |