Changeset 3330678
- Timestamp:
- 07/19/2025 04:17:47 PM (9 months ago)
- Location:
- cb-parallax/trunk
- Files:
-
- 21 edited
-
admin/class-admin.php (modified) (12 diffs)
-
admin/includes/class-contextual-help.php (modified) (3 diffs)
-
admin/includes/class-localisation.php (modified) (10 diffs)
-
admin/includes/class-meta-box.php (modified) (8 diffs)
-
admin/includes/class-post-type-support.php (modified) (3 diffs)
-
admin/includes/class-theme-support.php (modified) (2 diffs)
-
admin/menu/class-settings-page.php (modified) (11 diffs)
-
admin/menu/includes/class-ajax.php (modified) (3 diffs)
-
admin/menu/includes/class-options.php (modified) (22 diffs)
-
admin/menu/includes/class-validation.php (modified) (4 diffs)
-
admin/partials/class-help-sidebar-display.php (modified) (1 diff)
-
admin/partials/class-help-tab-display.php (modified) (4 diffs)
-
admin/partials/class-settings-display.php (modified) (11 diffs)
-
cb-parallax.php (modified) (3 diffs)
-
includes/class-activator.php (modified) (1 diff)
-
includes/class-cb-parallax-upgrade.php (modified) (4 diffs)
-
includes/class-cb-parallax.php (modified) (7 diffs)
-
includes/class-deactivator.php (modified) (1 diff)
-
includes/class-i18n.php (modified) (2 diffs)
-
public/class-public.php (modified) (7 diffs)
-
public/includes/class-public-localisation.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cb-parallax/trunk/admin/class-admin.php
r3330672 r3330678 132 132 * @return void 133 133 */ 134 private function include_post_type_support() 134 private function include_post_type_support() : void 135 135 { 136 136 $post_type_support = new AdminIncludes\cb_parallax_post_type_support(); … … 144 144 * @since 0.9.0 145 145 */ 146 public function add_hooks() 146 public function add_hooks() : void 147 147 { 148 148 $stored_options = get_option('cb_parallax_options'); … … 185 185 * @return void 186 186 */ 187 private function include_theme_support() 187 private function include_theme_support() : void 188 188 { 189 189 $wp_support = new AdminIncludes\cb_parallax_theme_support(); … … 196 196 * @return void 197 197 */ 198 private function include_contextual_help() 198 private function include_contextual_help() : void 199 199 { 200 200 $Help_Tab = new AdminIncludes\cb_parallax_contextual_help($this->domain); … … 207 207 * @return void 208 208 */ 209 private function include_settings_page() 209 private function include_settings_page() : void 210 210 { 211 211 $menu = new AdminMenu\cb_parallax_settings_page($this->domain, $this->screen_ids, $this->options); … … 218 218 * @return void 219 219 */ 220 private function include_ajax_functionality() 220 private function include_ajax_functionality() : void 221 221 { 222 222 $ajax = new MenuIncludes\cb_parallax_ajax($this->domain, $this->options); … … 230 230 * @since 0.9.0 231 231 */ 232 public function enqueue_styles() 232 public function enqueue_styles() : void 233 233 { 234 234 $screen = get_current_screen(); … … 260 260 * @since 0.9.0 261 261 */ 262 public function enqueue_scripts() 262 public function enqueue_scripts() : void 263 263 { 264 264 $screen = get_current_screen(); … … 322 322 * @return void 323 323 */ 324 public function include_meta_box() 324 public function include_meta_box() : void 325 325 { 326 326 $meta_box = new AdminIncludes\cb_parallax_meta_box($this->domain, $this->screen_ids, $this->options); … … 333 333 * @return void 334 334 */ 335 public function include_script_localisation() 335 public function include_script_localisation() : void 336 336 { 337 337 $script_localisation = new AdminIncludes\cb_parallax_localisation($this->domain, $this->screen_ids, $this->options); … … 347 347 * @return array $meta 348 348 */ 349 public function filter_plugin_row_meta(array $meta, string $file) 349 public function filter_plugin_row_meta(array $meta, string $file) : array 350 350 { 351 351 $plugin = plugin_basename('cb-parallax/cb-parallax.php'); … … 364 364 * and runs it. 365 365 */ 366 public function run_cb_parallax_upgrade() 366 public function run_cb_parallax_upgrade() : void 367 367 { 368 368 $upgrader = new Includes\cb_parallax_upgrade($this->domain, $this->version); -
cb-parallax/trunk/admin/includes/class-contextual-help.php
r3330670 r3330678 62 62 * @since 0.9.0 63 63 */ 64 private function initialize() 64 private function initialize() : void 65 65 { 66 66 add_action("load-{$GLOBALS['pagenow']}", array( … … 76 76 * @since 0.9.0 77 77 */ 78 public function add_hooks() 78 public function add_hooks() : void 79 79 { 80 80 add_action('in_admin_header', array( … … 103 103 * @since 0.9.0 104 104 */ 105 public function add_contextual_help() 105 public function add_contextual_help() : void 106 106 { 107 107 $current_screen = get_current_screen(); -
cb-parallax/trunk/admin/includes/class-localisation.php
r3330672 r3330678 40 40 * @var array $screen_ids 41 41 */ 42 private $screen_ids;42 private array $screen_ids; 43 43 44 44 /** … … 85 85 * @since 0.9.0 86 86 */ 87 public function add_hooks() 87 public function add_hooks() : void 88 88 { 89 89 if (is_admin()) { … … 108 108 * @param bool false | \WP_Post $post 109 109 */ 110 public function retrieve_image_options() 110 public function retrieve_image_options() : void 111 111 { 112 112 $current_screen = get_current_screen(); … … 192 192 * @return void 193 193 */ 194 public function localize() 194 public function localize() : void 195 195 { 196 196 global $post; … … 240 240 * @param bool false | WP_Post $post 241 241 */ 242 private function set_plugin_options($post = false) 242 private function set_plugin_options($post = false) : void 243 243 { 244 244 $this->plugin_options = $this->options->get_plugin_options($post); … … 250 250 * @param bool false | \WP_Post $post 251 251 */ 252 private function set_image_options($post = false) 252 private function set_image_options($post = false) : void 253 253 { 254 254 $this->image_options = $this->options->get_image_options($post); … … 263 263 * @return array $image_data 264 264 */ 265 private function get_image_data($attachment_id) 265 private function get_image_data($attachment_id) : array 266 266 { 267 267 $image_data = null; … … 285 285 * @return array 286 286 */ 287 public function get_strings() 287 public function get_strings() : array 288 288 { 289 289 return array_merge(array( … … 326 326 * @return string $image_data javascript-conform value for true or false 327 327 */ 328 private function can_parallax(array $image_data) 328 private function can_parallax(array $image_data) : string 329 329 { 330 330 $min_width = '1080'; … … 340 340 * @return void 341 341 */ 342 public function localize_media_frame() 342 public function localize_media_frame() : void 343 343 { 344 344 wp_localize_script('cb-parallax-settings-display-js', 'cbParallaxMediaFrame', array( -
cb-parallax/trunk/admin/includes/class-meta-box.php
r3330673 r3330678 84 84 * @var array $screen_ids 85 85 */ 86 private $screen_ids;86 private array $screen_ids; 87 87 88 88 /** … … 93 93 * @param MenuIncludes\cb_parallax_options $options 94 94 */ 95 public function __construct(string $domain, $screen_ids, MenuIncludes\cb_parallax_options $options)95 public function __construct(string $domain, array $screen_ids, MenuIncludes\cb_parallax_options $options) 96 96 { 97 97 $this->domain = $domain; … … 114 114 * @since 0.9.0 115 115 */ 116 public function add_hooks() 116 public function add_hooks() : void 117 117 { 118 118 //add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); … … 144 144 * @return void 145 145 */ 146 private function retrieve_options() 146 private function retrieve_options() : void 147 147 { 148 148 $this->allowed_image_options = $this->options->get_image_options_whitelist(); … … 153 153 * Adds the actions that add the meta box and add the callback for when the user saves a page or post. 154 154 */ 155 public function load_post() 155 public function load_post() : void 156 156 { 157 157 $screen = get_current_screen(); … … 189 189 * @return void 190 190 */ 191 public function add_meta_box(string $post_type) 191 public function add_meta_box(string $post_type) : void 192 192 { 193 193 $screen = get_current_screen(); … … 206 206 * @param \WP_Post $post 207 207 */ 208 public function meta_box_display($post) 208 public function meta_box_display($post) : void 209 209 { 210 210 global $post; … … 282 282 * @return void 283 283 */ 284 public function save_post($post_id, $post) 284 public function save_post($post_id, $post) : void 285 285 { 286 286 // Verify the nonce. -
cb-parallax/trunk/admin/includes/class-post-type-support.php
r3330670 r3330678 47 47 * @since 0.9.0 48 48 */ 49 public function add_hooks() 49 public function add_hooks() : void 50 50 { 51 51 add_action('init', array( … … 58 58 * Calls the WordPress function that adds support for the given feature applied on the given post type. 59 59 */ 60 public function add_post_type_support() 60 public function add_post_type_support() : void 61 61 { 62 62 foreach ($this->get_supported_post_types() as $post_type) { … … 70 70 * @return array 71 71 */ 72 public function get_supported_post_types() 72 public function get_supported_post_types() : array 73 73 { 74 74 $excluded_posttypes = array( -
cb-parallax/trunk/admin/includes/class-theme-support.php
r3330670 r3330678 39 39 * @since 0.9.0 40 40 */ 41 public function add_hooks() 41 public function add_hooks() : void 42 42 { 43 43 add_action('after_setup_theme', array( … … 50 50 * Calls the WordPress function that adds theme support for the given feature. 51 51 */ 52 public function add_theme_support() 52 public function add_theme_support() : void 53 53 { 54 54 add_theme_support($this->feature); -
cb-parallax/trunk/admin/menu/class-settings-page.php
r3330673 r3330678 56 56 * @var array $screen_ids 57 57 */ 58 private $screen_ids;58 private array $screen_ids; 59 59 60 60 /** … … 89 89 * @since 0.9.0 90 90 */ 91 public function add_hooks() 91 public function add_hooks() : void 92 92 { 93 93 add_action('admin_enqueue_scripts', array( … … 117 117 * if we're on a white-listed screen. 118 118 */ 119 private function init() 119 private function init() : void 120 120 { 121 121 if (in_array($this->screen_id, $this->screen_ids, true)) { … … 139 139 * @since 0.9.0 140 140 */ 141 public function enqueue_styles(string $hook_suffix) 141 public function enqueue_styles(string $hook_suffix) : void 142 142 { 143 143 if (isset($hook_suffix) && $hook_suffix === $this->screen_id) { … … 161 161 * @since 0.9.0 162 162 */ 163 public function enqueue_scripts(string $hook_suffix) 163 public function enqueue_scripts(string $hook_suffix) : void 164 164 { 165 165 if (isset($hook_suffix) && $hook_suffix === $this->screen_id) { … … 201 201 * @return string $classes 202 202 */ 203 public function add_body_class(string $classes) 203 public function add_body_class(string $classes) : string 204 204 { 205 205 $classes .= 'cb-parallax-settings-page '; … … 213 213 * @param string $hook_suffix 214 214 */ 215 public function include_menu_localisation(string $hook_suffix) 215 public function include_menu_localisation(string $hook_suffix) : void 216 216 { 217 217 if (isset($hook_suffix) && $hook_suffix === $this->screen_id) { … … 226 226 * @return void 227 227 */ 228 public function add_options_page() 228 public function add_options_page() : void 229 229 { 230 230 add_options_page(__('cbParallax Settings Page', $this->domain), 'cbParallax', 'manage_options', 'cb-parallax.php', array( … … 239 239 * @echo 240 240 */ 241 public function settings_display() 241 public function settings_display() : void 242 242 { 243 243 /** … … 249 249 250 250 $stored_options = get_option('cb_parallax_options'); 251 $attachment_id = isset($stored_options['cb_parallax_attachment_id']) ? $stored_options['cb_parallax_attachment_id'] : false;251 $attachment_id = isset($stored_options['cb_parallax_attachment_id']) ? $stored_options['cb_parallax_attachment_id'] : null; 252 252 $canParallax = isset($stored_options['cb_parallax_can_parallax']) ? $stored_options['cb_parallax_can_parallax'] : false; 253 253 $parallax_enabled = isset($stored_options['cb_parallax_can_parallax']) ? $stored_options['cb_parallax_can_parallax'] : false; … … 255 255 // Get image meta data 256 256 $image = null; 257 if ( false !== $attachment_id) {257 if (isset($attachment_id)) { 258 258 $image = wp_get_attachment_image_src(absint($attachment_id), 'full'); 259 259 } -
cb-parallax/trunk/admin/menu/includes/class-ajax.php
r3330672 r3330678 71 71 * @since 0.9.0 72 72 */ 73 public function add_hooks() 73 public function add_hooks() : void 74 74 { 75 75 add_action('wp_ajax_cb_parallax_save_options', array( … … 92 92 * @since 0.9.0 93 93 */ 94 public function cb_parallax_save_options() 94 public function cb_parallax_save_options() : void 95 95 { 96 96 $nonce = $_REQUEST['nonce']; … … 163 163 * @since 0.9.0 164 164 */ 165 public function cb_parallax_reset_options() 165 public function cb_parallax_reset_options() : void 166 166 { 167 167 $nonce = isset($_POST['nonce']) ? $_POST['nonce'] : false; -
cb-parallax/trunk/admin/menu/includes/class-options.php
r3330670 r3330678 71 71 * @return mixed 72 72 */ 73 private function plugin_options_whitelist() 73 private function plugin_options_whitelist() : mixed 74 74 { 75 75 $plugin_options['cb_parallax_allow_override'] = array( … … 120 120 return $plugin_options; 121 121 } 122 private function image_options_whitelist() 122 private function image_options_whitelist() : array 123 123 { 124 124 $image_options_whitelist['cb_parallax_attachment_id'] = array(); … … 203 203 * @return array $output 204 204 */ 205 private function convert_overlay_image_names_for_display(array $input) 205 private function convert_overlay_image_names_for_display(array $input) : array 206 206 { 207 207 $output = array(); … … 233 233 * @return mixed | bool false | array $names_list 234 234 */ 235 private function retrieve_overlay_image_names() 235 private function retrieve_overlay_image_names() : mixed 236 236 { 237 237 $path = CBPARALLAX_ROOT_DIR.'public/images/overlays/'; … … 262 262 * @return array|mixed 263 263 */ 264 public function get_image_options_whitelist() 264 public function get_image_options_whitelist() : mixed 265 265 { 266 266 return $this->image_options_whitelist; … … 272 272 * @return array|mixed 273 273 */ 274 public function get_plugin_options_whitelist() 274 public function get_plugin_options_whitelist() : mixed 275 275 { 276 276 return $this->plugin_options_whitelist; … … 284 284 * @return array $args 285 285 */ 286 public function get_options_arguments(string $section = '') 286 public function get_options_arguments(string $section = '') : array 287 287 { 288 288 if ('plugin' === $section) { … … 318 318 * @return array 319 319 */ 320 private function plugin_options() 320 private function plugin_options() : array 321 321 { 322 322 return array_merge(array( … … 395 395 * @return array 396 396 */ 397 private function image_options() 397 private function image_options() : array 398 398 { 399 399 return array( … … 573 573 * @return array|bool 574 574 */ 575 public function get_section_heading(string $section) 575 public function get_section_heading(string $section) : bool|array 576 576 { 577 577 $background_image_heading = array( … … 656 656 * @return string $result 657 657 */ 658 public function determine_image_source() 658 public function determine_image_source() : string 659 659 { 660 660 global $post; … … 682 682 * @return array $default_image_options 683 683 */ 684 public function get_default_image_options() 684 public function get_default_image_options() : array 685 685 { 686 686 $default_image_options = array(); … … 702 702 * @return array 703 703 */ 704 public function get_plugin_options($post = false) 705 { 704 public function get_plugin_options($post = false) : array 705 { 706 global $post; 707 706 708 $plugin_options = array(); 707 709 $stored_options = get_option('cb_parallax_options'); … … 711 713 // If a page or post is requested AND the options are fetched on a per post basis 712 714 if (is_a($post, '\WP_Post') && 'per_page' === $this->determine_options_source($post)) { 713 /**714 * @var \WP_Post $post715 */716 715 $post_meta = get_post_meta($post->ID, 'cb_parallax', true); 717 716 // Maybe overwrite the value with the one from the post meta data … … 733 732 * @return array $keys 734 733 */ 735 public function get_all_option_keys(string $section = '') 734 public function get_all_option_keys(string $section = '') : array 736 735 { 737 736 if ('plugin' === $section) { … … 759 758 * @return array $default_plugin_options 760 759 */ 761 public function get_default_plugin_options() 760 public function get_default_plugin_options() : array 762 761 { 763 762 $default_plugin_options = array(); … … 784 783 * @return string $result 785 784 */ 786 public function determine_options_source($post) 785 public function determine_options_source($post) : string 787 786 { 788 787 $stored_options = get_option('cb_parallax_options'); … … 820 819 * @return bool|\WP_Error 821 820 */ 822 public function save_options(array $input, $post_id = '') 821 public function save_options(array $input, $post_id = '') : WP_Error|bool 823 822 { 824 823 $validation = new MenuIncludes\cb_parallax_validation($this->domain, $this); … … 863 862 * @return \WP_Error | bool true 864 863 */ 865 public function reset_options($post_id) 864 public function reset_options($post_id) : WP_Error|bool 866 865 { 867 866 delete_option('cb_parallax_options'); … … 890 889 * @return array 891 890 */ 892 public function get_default_options(string $section = '') 891 public function get_default_options(string $section = '') : array 893 892 { 894 893 if ('image' == $section) { … … 936 935 * @return bool 937 936 */ 938 public function is_image_in_media_library($post) 937 public function is_image_in_media_library($post) : bool 939 938 { 940 939 $stored_image_options = $this->get_image_options($post); … … 980 979 * @return array $image_options 981 980 */ 982 public function get_image_options($post = false) 981 public function get_image_options($post = false) : array 983 982 { 984 983 global $post; -
cb-parallax/trunk/admin/menu/includes/class-validation.php
r3330672 r3330678 89 89 * and the default options, too. 90 90 */ 91 private function retrieve_options() 91 private function retrieve_options() : void 92 92 { 93 93 $this->image_options_whitelist = $this->options->get_image_options_whitelist(); … … 104 104 * @return array 105 105 */ 106 public function run($post_id, array $input) 106 public function run($post_id, array $input) : array 107 107 { 108 108 $input = $this->sanitize($input); … … 118 118 * @return array $output 119 119 */ 120 private function sanitize(array $input) 120 private function sanitize(array $input) : array 121 121 { 122 122 $output = array(); … … 139 139 * @return array $output 140 140 */ 141 public function validate_input($post_id, array $input) 141 public function validate_input($post_id, array $input) : array 142 142 { 143 143 if ('' === $post_id) { -
cb-parallax/trunk/admin/partials/class-help-sidebar-display.php
r3330669 r3330678 29 29 * @since 0.9.0 30 30 */ 31 public static function help_sidebar_display(string $domain, $current_screen) 31 public static function help_sidebar_display(string $domain, $current_screen) : string 32 32 { 33 33 $html = $current_screen->get_help_sidebar(); -
cb-parallax/trunk/admin/partials/class-help-tab-display.php
r3330669 r3330678 28 28 * @since 0.9.0 29 29 */ 30 public static function help_tab_display(string $domain) 30 public static function help_tab_display(string $domain) : string 31 31 { 32 32 ob_start(); … … 62 62 * @since 0.9.0 63 63 */ 64 public static function tab_content_general_settings(string $domain) 64 public static function tab_content_general_settings(string $domain) : string 65 65 { 66 66 /** … … 106 106 * @since 0.9.0 107 107 */ 108 public static function tab_content_scroll_directions(string $domain) 108 public static function tab_content_scroll_directions(string $domain) : string 109 109 { 110 110 $img_postfix = 'de_DE' === get_locale() ? 'de' : 'default'; … … 202 202 * @since 0.9.0 203 203 */ 204 public static function tab_content_plugin_information_and_privacy_notices(string $domain) 204 public static function tab_content_plugin_information_and_privacy_notices(string $domain) : string 205 205 { 206 206 ob_start(); -
cb-parallax/trunk/admin/partials/class-settings-display.php
r3330673 r3330678 104 104 * Holds the reference to the class that's responsible for validation operations. 105 105 */ 106 private function set_validation_instance() 106 private function set_validation_instance() : void 107 107 { 108 108 $this->validation = new MenuIncludes\cb_parallax_validation($this->domain, $this->options); … … 112 112 * Holds the array containing the default plugin options. 113 113 */ 114 private function set_default_plugin_options() 114 private function set_default_plugin_options() : void 115 115 { 116 116 $this->default_plugin_options = $this->options->get_default_plugin_options(); … … 120 120 * Holds the array containing the default image options. 121 121 */ 122 private function set_default_image_options() 122 private function set_default_image_options() : void 123 123 { 124 124 $this->default_image_options = $this->options->get_default_image_options(); … … 136 136 * @return string $html 137 137 */ 138 public function get_hidden_fields_display($attachment_id, string $url, $canParallax, $parallax_enabled) 138 public function get_hidden_fields_display($attachment_id, string $url, $canParallax, $parallax_enabled) : string 139 139 { 140 140 ob_start(); … … 173 173 * @return string $html 174 174 */ 175 public function get_media_button_display() 175 public function get_media_button_display() : string 176 176 { 177 177 ob_start(); … … 196 196 * @return string $html 197 197 */ 198 public function get_background_image_display(string $url, string $section = 'image') 198 public function get_background_image_display(string $url, string $section = 'image') : string 199 199 { 200 200 $placeholder_image_class = '' === $url ? '' : 'hidden'; … … 231 231 * @return string $html 232 232 */ 233 public function get_checkbox_display($value, array $args) 233 public function get_checkbox_display($value, array $args) : string 234 234 { 235 235 $option_key = $args['option_key']; … … 273 273 * @return string $html 274 274 */ 275 public function get_color_picker_field($value, array $args) 275 public function get_color_picker_field($value, array $args) : string 276 276 { 277 277 $option_key = $args['option_key']; … … 308 308 * @return string $html 309 309 */ 310 public function get_select_field($value, array $args) 310 public function get_select_field($value, array $args) : string 311 311 { 312 312 $option_key = $args['option_key']; … … 341 341 * @return string 342 342 */ 343 public function get_form_title() 343 public function get_form_title() : string 344 344 { 345 345 return '<h1>'.__('cbParallax Settings', $this->domain).'</h1>'; … … 353 353 * @return string 354 354 */ 355 public function get_settings_title(string $section) 355 public function get_settings_title(string $section) : string 356 356 { 357 357 if ('meta-box' === $section) { -
cb-parallax/trunk/cb-parallax.php
r3327032 r3330678 79 79 * @since 0.1.0 80 80 */ 81 function activate_plugin() 81 function activate_plugin() : void 82 82 { 83 83 Includes\cb_parallax_activator::activate(); … … 91 91 * @since 0.1.0 92 92 */ 93 function deactivate_plugin() 93 function deactivate_plugin() : void 94 94 { 95 95 Includes\cb_parallax_deactivator::deactivate(); … … 119 119 * @since 0.1.0 120 120 */ 121 function run_cb_parallax() 121 function run_cb_parallax() : void 122 122 { 123 123 $plugin = new Includes\cb_parallax(); -
cb-parallax/trunk/includes/class-activator.php
r3330670 r3330678 38 38 * @return void 39 39 */ 40 public static function activate() 40 public static function activate() : void 41 41 { 42 42 // Gets the administrator role. -
cb-parallax/trunk/includes/class-cb-parallax-upgrade.php
r3330673 r3330678 109 109 * and sets the required option values. 110 110 */ 111 private function retrieve_options() 111 private function retrieve_options() : void 112 112 { 113 113 $this->options = new MenuIncludes\cb_parallax_options($this->domain); … … 120 120 * Kicks off the options upgrader. 121 121 */ 122 public function run() 122 public function run() : void 123 123 { 124 124 // Upgrade options and post meta and Add a "flag" on success … … 130 130 } 131 131 } 132 133 private function upgrade_plugin_options() 132 private function upgrade_plugin_options() : bool 134 133 { 135 134 // Upgrade post meta of all posts and pages … … 256 255 } 257 256 } 258 259 private function add_upgrade_flag() 257 private function add_upgrade_flag() : void 260 258 { 261 259 update_option('cb_parallax_plugin', [ -
cb-parallax/trunk/includes/class-cb-parallax.php
r3330673 r3330678 99 99 * @return void 100 100 */ 101 private function set_options_instance() 101 private function set_options_instance() : void 102 102 { 103 103 $this->options = new MenuIncludes\cb_parallax_options($this->domain); … … 110 110 * @return void 111 111 */ 112 private function include_plugin_text_domain() 112 private function include_plugin_text_domain() : void 113 113 { 114 114 $i18n = new cb_parallax_i18n($this->domain); … … 122 122 * @return void 123 123 */ 124 public function run() 124 public function run() : void 125 125 { 126 126 $this->ensure_options(); … … 128 128 $this->run_public(); 129 129 } 130 131 private function ensure_options() 130 private function ensure_options() : void 132 131 { 133 132 $options = get_option('cb_parallax_options'); … … 136 135 } 137 136 } 138 139 public function set_initial_plugin_options() 137 public function set_initial_plugin_options() : void 140 138 { 141 139 $cb_parallax_options = new MenuIncludes\cb_parallax_options('cb-parallax'); … … 150 148 * @return void 151 149 */ 152 private function run_admin() 150 private function run_admin() : void 153 151 { 154 152 if (!is_admin()) { … … 166 164 * @return void 167 165 */ 168 private function run_public() 166 private function run_public() : void 169 167 { 170 168 // If it's admin, which it shouldn't be, we stop here -
cb-parallax/trunk/includes/class-deactivator.php
r3330670 r3330678 39 39 * @return void 40 40 */ 41 public static function deactivate() 41 public static function deactivate() : void 42 42 { 43 43 // Gets the administrator role. -
cb-parallax/trunk/includes/class-i18n.php
r3330670 r3330678 52 52 * @since 0.9.0 53 53 */ 54 public function add_hooks() 54 public function add_hooks() : void 55 55 { 56 56 add_action('init', array( … … 63 63 * Calls the WordPress function that loads this plugin's translated strings. 64 64 */ 65 public function load_plugin_textdomain() 65 public function load_plugin_textdomain() : void 66 66 { 67 67 load_plugin_textdomain($this->domain, false, dirname(dirname(plugin_basename(__FILE__))).'/languages/'); -
cb-parallax/trunk/public/class-public.php
r3330673 r3330678 81 81 * @param bool false | WP_Post $post 82 82 */ 83 private function set_plugin_options($post = false) 83 private function set_plugin_options($post = false) : void 84 84 { 85 85 $this->plugin_options = $this->options->get_plugin_options($post); … … 92 92 * @since 0.9.0 93 93 */ 94 private function include_public_localisation() 94 private function include_public_localisation() : void 95 95 { 96 96 $localisation = new PublicIncludes\cb_parallax_public_localisation($this->domain, $this->options); … … 104 104 * @since 0.9.0 105 105 */ 106 public function add_hooks() 106 public function add_hooks() : void 107 107 { 108 108 add_action('wp_enqueue_scripts', [ … … 127 127 * @since 0.9.0 128 128 */ 129 public function enqueue_styles() 129 public function enqueue_styles() : void 130 130 { 131 131 /** … … 149 149 * @since 0.9.0 150 150 */ 151 public function enqueue_scripts() 151 public function enqueue_scripts() : void 152 152 { 153 153 /** … … 188 188 } 189 189 } 190 191 public function enqueue_layout_scripts() 190 public function enqueue_layout_scripts() : void 192 191 { 193 192 /** … … 216 215 } 217 216 } 218 219 public function enqueue_parallax_scripts() 217 public function enqueue_parallax_scripts() : void 220 218 { 221 219 /** -
cb-parallax/trunk/public/includes/class-public-localisation.php
r3330673 r3330678 95 95 * @param bool false | \WP_Post $post 96 96 */ 97 private function set_image_options($post = false) 97 private function set_image_options($post = false) : void 98 98 { 99 99 $this->image_options = $this->options->get_image_options($post); … … 105 105 * @param bool false | WP_Post $post 106 106 */ 107 private function set_plugin_options($post = false) 107 private function set_plugin_options($post = false) : void 108 108 { 109 109 $this->plugin_options = $this->options->get_plugin_options($post); … … 116 116 * @since 0.9.0 117 117 */ 118 public function add_hooks() 118 public function add_hooks() : void 119 119 { 120 120 add_action('wp_enqueue_scripts', [ … … 130 130 * @return void 131 131 */ 132 public function localize_frontend() 132 public function localize_frontend() : void 133 133 { 134 134 /** … … 161 161 } 162 162 } 163 164 private function getPrepareData() 163 private function getPrepareData() : array 165 164 { 166 165 /** … … 215 214 * @return array $image_data 216 215 */ 217 private function get_image_data($attachment_id) 216 private function get_image_data($attachment_id) : array 218 217 { 219 218 $image_data = array(); … … 238 237 * @return array $overlay_options 239 238 */ 240 private function get_overlay_options(array $stored_image_options) 239 private function get_overlay_options(array $stored_image_options) : array 241 240 { 242 241 $overlay_image_select_values = $this->options->get_image_options_whitelist(); … … 268 267 * @return string $image_data javascript-conform value for true or false 269 268 */ 270 private function can_parallax(array $image_data) 269 private function can_parallax(array $image_data) : string 271 270 { 272 271 $min_width = '1080';
Note: See TracChangeset
for help on using the changeset viewer.