Changeset 3013787
- Timestamp:
- 12/24/2023 10:40:29 AM (8 months ago)
- Location:
- smntcs-pinterest-save-button
- Files:
-
- 18 added
- 2 deleted
- 10 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
smntcs-pinterest-save-button/tags/1.7/README.md
r2828067 r3013787 27 27 ## Changelog 28 28 29 30 31 32 29 33 ### 1.6 (2022.12.03) 30 34 -
smntcs-pinterest-save-button/tags/1.7/README.txt
r2828067 r3013787 3 3 Contributors: nielslange 4 4 Tags: Pinterest, Pinterest Save Button, Pinterest Button 5 Stable tag: 1. 66 Tested up to: 6. 15 Stable tag: 1. 6 Tested up to: 6. 7 7 Requires PHP: 5.6 8 8 Requires at least: 3.4 … … 31 31 32 32 == Changelog == 33 34 35 36 33 37 34 38 = 1.6 (2022.12.03) = -
smntcs-pinterest-save-button/tags/1.7/composer.json
r2828067 r3013787 9 9 ], 10 10 "homepage": "https://github.com/nielslange/smntcs-pinterest-save-button", 11 12 13 14 11 15 "license": "GPL-3.0-or-later", 12 16 "authors": [ … … 20 24 }, 21 25 "require-dev": { 22 "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", 23 "jakub-onderka/php-parallel-lint": "^1.0", 24 "wptrt/wpthemereview": "^0.2.1" 26 "dealerdirect/phpcodesniffer-composer-installer": "^0.7.1", 27 "wptrt/wpthemereview": "^0.2.1", �� 28 "humanmade/psalm-plugin-wordpress": "^2.2", 29 "overtrue/phplint": "^3.4", 30 "phpcompatibility/phpcompatibility-all": "^1.1", 31 "squizlabs/php_codesniffer": "^3.8", 32 "vimeo/psalm": "^4.30", 33 "wp-coding-standards/wpcs": "^2.3", 34 "php-parallel-lint/php-parallel-lint": "^1.1" 25 35 }, 26 36 "scripts": { 27 "checkcs": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --runtime-set testVersion 5.6-", 28 "fixcs": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf --runtime-set testVersion 5.6-", 29 "lint": "@php ./vendor/bin/parallel-lint --exclude .git --exclude vendor ." 37 "phpcbf": "phpcbf --standard=phpcs.xml .", 38 "phpcs": "phpcs --standard=phpcs.xml .", 39 "phplint": "phplint", 40 "psalm": "psalm --no-cache" 30 41 }, 31 "support": { 32 "issues": "https://github.com/nielslange/smntcs-pinterest-save-button/issues", 33 "source": "https://github.com/nielslange/smntcs-pinterest-save-button" 42 "config": { 43 "allow-plugins": { 44 "dealerdirect/phpcodesniffer-composer-installer": true 45 } 34 46 } 35 47 } -
smntcs-pinterest-save-button/tags/1.7/package.json
r2220934 r3013787 19 19 }, 20 20 "devDependencies": { 21 "@wordpress/scripts": "^5.0.0" 21 "@wordpress/prettier-config": "3.5.0", 22 "@wordpress/scripts": "^5.0.0", 23 "eslint": "8.56.0", 24 "npm-run-all": "4.1.5" 22 25 }, 23 26 "scripts": { 24 "lint:pkg-json": "wp-scripts lint-pkg-json" 27 "lint:pkg-json": "wp-scripts lint-pkg-json", 28 "test": "npm-run-all --parallel phpcs phplint psalm", 29 "phpcbf": "composer run phpcbf", 30 "phpcs": "composer run phpcs", 31 "phplint": "composer run phplint", 32 "psalm": "composer run psalm" 25 33 } 26 34 } -
smntcs-pinterest-save-button/tags/1.7/smntcs-pinterest-save-button.php
r2828067 r3013787 7 7 * Author URI: https://nielslange.de 8 8 * Text Domain: smntcs-pinterest-save-button 9 * Version: 1. 69 * Version: 1. 10 10 * Requires PHP: 5.6 11 11 * Requires at least: 3.4 … … 16 16 */ 17 17 18 18 19 defined( 'ABSPATH' ) || exit; 19 20 20 /** 21 * Add Pinterest Save Button to WordPress Customizer 22 * 23 * @param WP_Customize_Manager $wp_customize The instance of WP_Customize_Manager. 24 * @return void 25 * @since 1.0.0 26 */ 27 function smntcs_pinterest_save_button_register_customize( $wp_customize ) { 28 $wp_customize->add_section( 29 'pinterest_save_button_section', 30 array( 31 'title' => __( 'Pinterest Save Button', 'smntcs-pinterest-save-button' ), 32 'priority' => 150, 33 ) 34 ); 35 36 $wp_customize->add_setting( 37 'show_button_on_hover', 38 array( 39 'default' => false, 40 ) 41 ); 42 43 $wp_customize->add_control( 44 'show_button_on_hover', 45 array( 46 'label' => __( 'Show button on hover', 'smntcs-pinterest-save-button' ), 47 'section' => 'pinterest_save_button_section', 48 'type' => 'checkbox', 49 ) 50 ); 51 52 $wp_customize->add_setting( 53 'show_round_button', 54 array( 55 'default' => false, 56 ) 57 ); 58 59 $wp_customize->add_control( 60 'show_round_button', 61 array( 62 'label' => __( 'Show round button', 'smntcs-pinterest-save-button' ), 63 'section' => 'pinterest_save_button_section', 64 'type' => 'checkbox', 65 ) 66 ); 67 68 $wp_customize->add_setting( 69 'show_large_button', 70 array( 71 'default' => false, 72 ) 73 ); 74 75 $wp_customize->add_control( 76 'show_large_button', 77 array( 78 'label' => __( 'Show large button', 'smntcs-pinterest-save-button' ), 79 'section' => 'pinterest_save_button_section', 80 'type' => 'checkbox', 81 ) 82 ); 83 } 84 add_action( 'customize_register', 'smntcs_pinterest_save_button_register_customize' ); 85 86 /** 87 * Enqueue Pinterest script 88 * 89 * @since 1.0.0 90 */ 91 function smntcs_pinterest_save_button_enqueue_pinterest_script() { 92 if ( true === get_theme_mod( 'show_button_on_hover' ) ) { 93 94 // Prepare standard button. 95 $script = '<script async defer data-pin-hover="true" data-pin-save="true" '; 96 97 // Display round button (if requested). 98 if ( true === get_theme_mod( 'show_round_button' ) ) { 99 $script .= 'data-pin-round="true" '; 100 } 101 102 // Display large button (if requested). 103 if ( true === get_theme_mod( 'show_large_button' ) ) { 104 $script .= 'data-pin-tall="true" '; 105 } 106 107 // Finalize standard button. 108 $script .= 'src="//assets.pinterest.com/js/pinit.js"></script>'; 109 110 // Show Pinterest Save Button. 111 print( $script ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 112 } 113 } 114 add_action( 'wp_footer', 'smntcs_pinterest_save_button_enqueue_pinterest_script' ); 21 // Load plugin classes. 22 require_once plugin_dir_path( __FILE__ ) . 'includes/class-smntcs-pinterest-save-button.php'; -
smntcs-pinterest-save-button/trunk/README.md
r2828067 r3013787 27 27 ## Changelog 28 28 29 30 31 32 29 33 ### 1.6 (2022.12.03) 30 34 -
smntcs-pinterest-save-button/trunk/README.txt
r2828067 r3013787 3 3 Contributors: nielslange 4 4 Tags: Pinterest, Pinterest Save Button, Pinterest Button 5 Stable tag: 1. 66 Tested up to: 6. 15 Stable tag: 1. 6 Tested up to: 6. 7 7 Requires PHP: 5.6 8 8 Requires at least: 3.4 … … 31 31 32 32 == Changelog == 33 34 35 36 33 37 34 38 = 1.6 (2022.12.03) = -
smntcs-pinterest-save-button/trunk/composer.json
r2828067 r3013787 9 9 ], 10 10 "homepage": "https://github.com/nielslange/smntcs-pinterest-save-button", 11 12 13 14 11 15 "license": "GPL-3.0-or-later", 12 16 "authors": [ … … 20 24 }, 21 25 "require-dev": { 22 "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", 23 "jakub-onderka/php-parallel-lint": "^1.0", 24 "wptrt/wpthemereview": "^0.2.1" 26 "dealerdirect/phpcodesniffer-composer-installer": "^0.7.1", 27 "wptrt/wpthemereview": "^0.2.1", 28 "humanmade/psalm-plugin-wordpress": "^2.2", 29 "overtrue/phplint": "^3.4", 30 "phpcompatibility/phpcompatibility-all": "^1.1", 31 "squizlabs/php_codesniffer": "^3.8", 32 "vimeo/psalm": "^4.30", 33 "wp-coding-standards/wpcs": "^2.3", 34 "php-parallel-lint/php-parallel-lint": "^1.1" 25 35 }, 26 36 "scripts": { 27 "checkcs": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --runtime-set testVersion 5.6-", 28 "fixcs": "@php ./vendor/squizlabs/php_codesniffer/bin/phpcbf --runtime-set testVersion 5.6-", 29 "lint": "@php ./vendor/bin/parallel-lint --exclude .git --exclude vendor ." 37 "phpcbf": "phpcbf --standard=phpcs.xml .", 38 "phpcs": "phpcs --standard=phpcs.xml .", 39 "phplint": "phplint", 40 "psalm": "psalm --no-cache" 30 41 }, 31 "support": { 32 "issues": "https://github.com/nielslange/smntcs-pinterest-save-button/issues", 33 "source": "https://github.com/nielslange/smntcs-pinterest-save-button" 42 "config": { 43 "allow-plugins": { 44 "dealerdirect/phpcodesniffer-composer-installer": true 45 } 34 46 } 35 47 } -
smntcs-pinterest-save-button/trunk/package.json
r2220934 r3013787 19 19 }, 20 20 "devDependencies": { 21 "@wordpress/scripts": "^5.0.0" 21 "@wordpress/prettier-config": "3.5.0", 22 "@wordpress/scripts": "^5.0.0", 23 "eslint": "8.56.0", 24 "npm-run-all": "4.1.5" 22 25 }, 23 26 "scripts": { 24 "lint:pkg-json": "wp-scripts lint-pkg-json" 27 "lint:pkg-json": "wp-scripts lint-pkg-json", 28 "test": "npm-run-all --parallel phpcs phplint psalm", 29 "phpcbf": "composer run phpcbf", 30 "phpcs": "composer run phpcs", 31 "phplint": "composer run phplint", 32 "psalm": "composer run psalm" 25 33 } 26 34 } -
smntcs-pinterest-save-button/trunk/smntcs-pinterest-save-button.php
r2828067 r3013787 7 7 * Author URI: https://nielslange.de 8 8 * Text Domain: smntcs-pinterest-save-button 9 * Version: 1. 69 * Version: 1. 10 10 * Requires PHP: 5.6 11 11 * Requires at least: 3.4 … … 16 16 */ 17 17 18 18 19 defined( 'ABSPATH' ) || exit; 19 20 20 /** 21 * Add Pinterest Save Button to WordPress Customizer 22 * 23 * @param WP_Customize_Manager $wp_customize The instance of WP_Customize_Manager. 24 * @return void 25 * @since 1.0.0 26 */ 27 function smntcs_pinterest_save_button_register_customize( $wp_customize ) { 28 $wp_customize->add_section( 29 'pinterest_save_button_section', 30 array( 31 'title' => __( 'Pinterest Save Button', 'smntcs-pinterest-save-button' ), 32 'priority' => 150, 33 ) 34 ); 35 36 $wp_customize->add_setting( 37 'show_button_on_hover', 38 array( 39 'default' => false, 40 ) 41 ); 42 43 $wp_customize->add_control( 44 'show_button_on_hover', 45 array( 46 'label' => __( 'Show button on hover', 'smntcs-pinterest-save-button' ), 47 'section' => 'pinterest_save_button_section', 48 'type' => 'checkbox', 49 ) 50 ); 51 52 $wp_customize->add_setting( 53 'show_round_button', 54 array( 55 'default' => false, 56 ) 57 ); 58 59 $wp_customize->add_control( 60 'show_round_button', 61 array( 62 'label' => __( 'Show round button', 'smntcs-pinterest-save-button' ), 63 'section' => 'pinterest_save_button_section', 64 'type' => 'checkbox', 65 ) 66 ); 67 68 $wp_customize->add_setting( 69 'show_large_button', 70 array( 71 'default' => false, 72 ) 73 ); 74 75 $wp_customize->add_control( 76 'show_large_button', 77 array( 78 'label' => __( 'Show large button', 'smntcs-pinterest-save-button' ), 79 'section' => 'pinterest_save_button_section', 80 'type' => 'checkbox', 81 ) 82 ); 83 } 84 add_action( 'customize_register', 'smntcs_pinterest_save_button_register_customize' ); 85 86 /** 87 * Enqueue Pinterest script 88 * 89 * @since 1.0.0 90 */ 91 function smntcs_pinterest_save_button_enqueue_pinterest_script() { 92 if ( true === get_theme_mod( 'show_button_on_hover' ) ) { 93 94 // Prepare standard button. 95 $script = '<script async defer data-pin-hover="true" data-pin-save="true" '; 96 97 // Display round button (if requested). 98 if ( true === get_theme_mod( 'show_round_button' ) ) { 99 $script .= 'data-pin-round="true" '; 100 } 101 102 // Display large button (if requested). 103 if ( true === get_theme_mod( 'show_large_button' ) ) { 104 $script .= 'data-pin-tall="true" '; 105 } 106 107 // Finalize standard button. 108 $script .= 'src="//assets.pinterest.com/js/pinit.js"></script>'; 109 110 // Show Pinterest Save Button. 111 print( $script ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped 112 } 113 } 114 add_action( 'wp_footer', 'smntcs_pinterest_save_button_enqueue_pinterest_script' ); 21 // Load plugin classes. 22 require_once plugin_dir_path( __FILE__ ) . 'includes/class-smntcs-pinterest-save-button.php';
Note: See TracChangeset
for help on using the changeset viewer.