Changeset 3080457
- Timestamp:
- 05/02/2024 02:20:57 PM (2 years ago)
- Location:
- decoupled-preview
- Files:
-
- 8 edited
- 1 copied
-
tags/1.0.6 (copied) (copied from decoupled-preview/trunk)
-
tags/1.0.6/readme.txt (modified) (2 diffs)
-
tags/1.0.6/src/class-decoupled-preview-settings.php (modified) (5 diffs)
-
tags/1.0.6/src/class-list-table.php (modified) (4 diffs)
-
tags/1.0.6/wp-decoupled-preview.php (modified) (3 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/class-decoupled-preview-settings.php (modified) (5 diffs)
-
trunk/src/class-list-table.php (modified) (4 diffs)
-
trunk/wp-decoupled-preview.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
decoupled-preview/tags/1.0.6/readme.txt
r2960763 r3080457 2 2 Contributors: getpantheon, backlineint, abhisekmazumdar, jspellman,jazzs3quence 3 3 Tags: headless,next.js,decoupled,preview 4 Tested up to: 6.3 5 Stable tag: 1.0. 54 Tested up to: 6.3.1 5 Stable tag: 1.0.6 6 6 License: GPL2 or later 7 7 License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html … … 56 56 == Changelog == 57 57 58 = 1.0.6 May 2, 2024 = 59 * Updates Pantheon WP Coding Standards to 2.0 [[#63](https://github.com/pantheon-systems/wp-decoupled-preview/pull/63)] 60 * Fixes an issue with broken activation and deactivation hooks 61 58 62 = 1.0.5 = 59 63 * Preview Button Regression in WordPress 6.3. [[#58](https://github.com/pantheon-systems/wp-decoupled-preview/pull/58)] -
decoupled-preview/tags/1.0.6/src/class-decoupled-preview-settings.php
r2955124 r3080457 357 357 * @return array 358 358 */ 359 public function get_allowed_post_types() : array {359 public function get_allowed_post_types(): array { 360 360 /** 361 361 * Allow the allowable post types to be filtered. … … 380 380 * @return string 381 381 */ 382 public function sanitize_preview_type( string $type ) : string {382 public function sanitize_preview_type( string $type ): string { 383 383 /** 384 384 * Allow the allowable preview types to be filtered. … … 415 415 * @return int 416 416 */ 417 public function validate_preview_id( int $edit_id, $options = [] ) : int {417 public function validate_preview_id( int $edit_id, $options = [] ): int { 418 418 if ( empty( $options ) ) { 419 419 $options = get_option( 'preview_sites' ); … … 644 644 * @return array 645 645 */ 646 public function remove_site_from_list( int $site_id = null ) : array {646 public function remove_site_from_list( int $site_id = null ): array { 647 647 $site = $this->get_preview_site( $site_id ); 648 648 $sites = get_option( 'preview_sites' ); … … 690 690 * @return array The updated array of preview sites. 691 691 */ 692 public function filter_preview_sites( array $preview_sites ) : array {692 public function filter_preview_sites( array $preview_sites ): array { 693 693 if ( count( $preview_sites ) < 1 ) { 694 694 return $preview_sites; -
decoupled-preview/tags/1.0.6/src/class-list-table.php
r2955124 r3080457 54 54 * @return array 55 55 */ 56 public function get_sortable_columns() : array {56 public function get_sortable_columns(): array { 57 57 return [ 58 58 'label' => [ 'label', true ], … … 70 70 * @return int 71 71 */ 72 private function usort_reorder( $a, $b ) : int {72 private function usort_reorder( $a, $b ): int { 73 73 // Similar to the above, I don't think we need to check the nonce here because we're not processing any information other than the sort order. 74 74 $orderby = ( ! empty( $_GET['orderby'] ) ) ? sanitize_text_field( wp_unslash( $_GET['orderby'] ) ) : 'label'; // phpcs:ignore WordPress.Security.NonceVerification.Recommended … … 92 92 * @return array 93 93 */ 94 public function get_columns() : array {94 public function get_columns(): array { 95 95 return [ 96 96 'label' => __( 'Label', 'wp-decoupled-preview' ), … … 110 110 * @return string 111 111 */ 112 public function column_default( $item, $column_name ) : string {112 public function column_default( $item, $column_name ): string { 113 113 switch ( $column_name ) { 114 114 case 'label': -
decoupled-preview/tags/1.0.6/wp-decoupled-preview.php
r2960763 r3080457 4 4 * Plugin URI: https://github.com/pantheon-systems/wp-decoupled-preview 5 5 * Description: Preview WordPress content on Front-end sites including Next.js 6 * Version: 1.0. 56 * Version: 1.0.6 7 7 * Author: Pantheon 8 8 * Author URI: https://pantheon.io/ … … 34 34 35 35 // Load the settings class and kick it off. 36 require_once dirname( __FILE__ ). '/src/class-decoupled-preview-settings.php';36 require_once __DIR__ . '/src/class-decoupled-preview-settings.php'; 37 37 new Decoupled_Preview_Settings(); 38 38 39 39 add_action( 'init', __NAMESPACE__ . '\\conditionally_enqueue_scripts' ); 40 40 add_action( 'updated_option', __NAMESPACE__ . '\\redirect_to_preview_site' ); 41 42 // Register activation and deactivation hooks.43 register_activation_hook( __FILE__, __NAMESPACE__ . '\\set_default_options' );44 register_deactivation_hook( __FILE__, __NAMESPACE__ . '\\delete_default_options' );45 41 } 46 42 … … 167 163 */ 168 164 function override_preview_template() { 169 return trailingslashit( dirname( __FILE__ )) . 'templates/preview-template.php';165 return trailingslashit( __DIR__ ) . 'templates/preview-template.php'; 170 166 } 171 167 -
decoupled-preview/trunk/readme.txt
r2960763 r3080457 2 2 Contributors: getpantheon, backlineint, abhisekmazumdar, jspellman,jazzs3quence 3 3 Tags: headless,next.js,decoupled,preview 4 Tested up to: 6.3 5 Stable tag: 1.0. 54 Tested up to: 6.3.1 5 Stable tag: 1.0.6 6 6 License: GPL2 or later 7 7 License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html … … 56 56 == Changelog == 57 57 58 = 1.0.6 May 2, 2024 = 59 * Updates Pantheon WP Coding Standards to 2.0 [[#63](https://github.com/pantheon-systems/wp-decoupled-preview/pull/63)] 60 * Fixes an issue with broken activation and deactivation hooks 61 58 62 = 1.0.5 = 59 63 * Preview Button Regression in WordPress 6.3. [[#58](https://github.com/pantheon-systems/wp-decoupled-preview/pull/58)] -
decoupled-preview/trunk/src/class-decoupled-preview-settings.php
r2955124 r3080457 357 357 * @return array 358 358 */ 359 public function get_allowed_post_types() : array {359 public function get_allowed_post_types(): array { 360 360 /** 361 361 * Allow the allowable post types to be filtered. … … 380 380 * @return string 381 381 */ 382 public function sanitize_preview_type( string $type ) : string {382 public function sanitize_preview_type( string $type ): string { 383 383 /** 384 384 * Allow the allowable preview types to be filtered. … … 415 415 * @return int 416 416 */ 417 public function validate_preview_id( int $edit_id, $options = [] ) : int {417 public function validate_preview_id( int $edit_id, $options = [] ): int { 418 418 if ( empty( $options ) ) { 419 419 $options = get_option( 'preview_sites' ); … … 644 644 * @return array 645 645 */ 646 public function remove_site_from_list( int $site_id = null ) : array {646 public function remove_site_from_list( int $site_id = null ): array { 647 647 $site = $this->get_preview_site( $site_id ); 648 648 $sites = get_option( 'preview_sites' ); … … 690 690 * @return array The updated array of preview sites. 691 691 */ 692 public function filter_preview_sites( array $preview_sites ) : array {692 public function filter_preview_sites( array $preview_sites ): array { 693 693 if ( count( $preview_sites ) < 1 ) { 694 694 return $preview_sites; -
decoupled-preview/trunk/src/class-list-table.php
r2955124 r3080457 54 54 * @return array 55 55 */ 56 public function get_sortable_columns() : array {56 public function get_sortable_columns(): array { 57 57 return [ 58 58 'label' => [ 'label', true ], … … 70 70 * @return int 71 71 */ 72 private function usort_reorder( $a, $b ) : int {72 private function usort_reorder( $a, $b ): int { 73 73 // Similar to the above, I don't think we need to check the nonce here because we're not processing any information other than the sort order. 74 74 $orderby = ( ! empty( $_GET['orderby'] ) ) ? sanitize_text_field( wp_unslash( $_GET['orderby'] ) ) : 'label'; // phpcs:ignore WordPress.Security.NonceVerification.Recommended … … 92 92 * @return array 93 93 */ 94 public function get_columns() : array {94 public function get_columns(): array { 95 95 return [ 96 96 'label' => __( 'Label', 'wp-decoupled-preview' ), … … 110 110 * @return string 111 111 */ 112 public function column_default( $item, $column_name ) : string {112 public function column_default( $item, $column_name ): string { 113 113 switch ( $column_name ) { 114 114 case 'label': -
decoupled-preview/trunk/wp-decoupled-preview.php
r2960763 r3080457 4 4 * Plugin URI: https://github.com/pantheon-systems/wp-decoupled-preview 5 5 * Description: Preview WordPress content on Front-end sites including Next.js 6 * Version: 1.0. 56 * Version: 1.0.6 7 7 * Author: Pantheon 8 8 * Author URI: https://pantheon.io/ … … 34 34 35 35 // Load the settings class and kick it off. 36 require_once dirname( __FILE__ ). '/src/class-decoupled-preview-settings.php';36 require_once __DIR__ . '/src/class-decoupled-preview-settings.php'; 37 37 new Decoupled_Preview_Settings(); 38 38 39 39 add_action( 'init', __NAMESPACE__ . '\\conditionally_enqueue_scripts' ); 40 40 add_action( 'updated_option', __NAMESPACE__ . '\\redirect_to_preview_site' ); 41 42 // Register activation and deactivation hooks.43 register_activation_hook( __FILE__, __NAMESPACE__ . '\\set_default_options' );44 register_deactivation_hook( __FILE__, __NAMESPACE__ . '\\delete_default_options' );45 41 } 46 42 … … 167 163 */ 168 164 function override_preview_template() { 169 return trailingslashit( dirname( __FILE__ )) . 'templates/preview-template.php';165 return trailingslashit( __DIR__ ) . 'templates/preview-template.php'; 170 166 } 171 167
Note: See TracChangeset
for help on using the changeset viewer.