mylittlepangreas
Forum Replies Created
-
Forum: Plugins
In reply to: [Webcomic] WordPress Customizer Doesn’t Work When Webcomic is EnabledNever mind, this broke the links for the comics, do the function for checking for array is working nice
Forum: Plugins
In reply to: [Webcomic] WordPress Customizer Doesn’t Work When Webcomic is EnabledI was able to fix this issue by commenting on a section of a function on the general.php under lib\collection\settings\general.php.
function general() { add_filter( 'admin_init', __NAMESPACE__ . '\hook_add_section_general' ); add_filter( 'admin_init', __NAMESPACE__ . '\hook_add_field_name' ); add_filter( 'admin_init', __NAMESPACE__ . '\hook_add_field_slug' ); add_filter( 'admin_init', __NAMESPACE__ . '\hook_add_field_permalink' ); add_filter( 'admin_init', __NAMESPACE__ . '\hook_add_field_description' ); add_filter( 'admin_init', __NAMESPACE__ . '\hook_add_field_media' ); add_filter( 'admin_init', __NAMESPACE__ . '\hook_add_field_archive' ); add_filter( 'admin_init', __NAMESPACE__ . '\hook_add_field_syndicate' ); add_filter( 'admin_init', __NAMESPACE__ . '\hook_add_field_supports' ); add_filter( 'admin_head', __NAMESPACE__ . '\hook_add_help_general' ); add_filter( 'current_screen', __NAMESPACE__ . '\hook_enqueue_media_manager' ); add_filter( 'delete_attachment', __NAMESPACE__ . '\hook_delete_collection_media' ); /** add_filter( 'display_media_states', __NAMESPACE__ . '\hook_add_collection_media_state' ); */
And adding an array verification if statement into the next function inside de media.php on \lib\collection\media.php
function hook_add_post_media_states( array $states ) : array { $comics = get_post_meta( get_the_ID(), 'webcomic_post' ); if (is_array($comics) || is_object($comics)) { foreach ( $comics as $comic ) { $collection = get_post_type( $comic ); if ( isset( $states[ $collection ] ) ) { continue; } elseif ( ! webcomic_collection_exists( $collection ) ) { delete_post_meta( get_the_ID(), 'webcomic_post', $comic ); continue; } // Translators: Post type name. $states[ $collection ] = sprintf( __( '%s Comic Image', 'webcomic' ), webcomic( "option.{$collection}.name" ) ); } } return $states; }
Now I’m sure the function modification will not break anything but I’m not sure what will happen with commenting on the argument on the first general.php part.
Forum: Plugins
In reply to: [Webcomic] WordPress Customizer Doesn’t Work When Webcomic is EnabledThis is the PHP error I get when I change the background image and causes the customizer to break.
[22-Jun-2021 18:48:02 UTC] PHP Warning: Invalid argument supplied for foreach() in C:\wamp64\www\wordpress\wp-content\plugins\webcomic\lib\collection\media.php on line 190 [22-Jun-2021 18:48:02 UTC] PHP Stack trace: [22-Jun-2021 18:48:02 UTC] PHP 1. {main}() C:\wamp64\www\wordpress\wp-admin\customize.php:0 [22-Jun-2021 18:48:02 UTC] PHP 2. do_action() C:\wamp64\www\wordpress\wp-admin\customize.php:281 [22-Jun-2021 18:48:02 UTC] PHP 3. WP_Hook->do_action() C:\wamp64\www\wordpress\wp-includes\plugin.php:484 [22-Jun-2021 18:48:02 UTC] PHP 4. WP_Hook->apply_filters() C:\wamp64\www\wordpress\wp-includes\class-wp-hook.php:316 [22-Jun-2021 18:48:02 UTC] PHP 5. WP_Customize_Manager->customize_pane_settings() C:\wamp64\www\wordpress\wp-includes\class-wp-hook.php:292 [22-Jun-2021 18:48:02 UTC] PHP 6. WP_Customize_Background_Image_Control->json() C:\wamp64\www\wordpress\wp-includes\class-wp-customize-manager.php:4969 [22-Jun-2021 18:48:02 UTC] PHP 7. WP_Customize_Background_Image_Control->to_json() C:\wamp64\www\wordpress\wp-includes\class-wp-customize-control.php:336 [22-Jun-2021 18:48:02 UTC] PHP 8. wp_prepare_attachment_for_js() C:\wamp64\www\wordpress\wp-includes\customize\class-wp-customize-upload-control.php:61 [22-Jun-2021 18:48:02 UTC] PHP 9. get_media_states() C:\wamp64\www\wordpress\wp-includes\media.php:4126 [22-Jun-2021 18:48:02 UTC] PHP 10. apply_filters() C:\wamp64\www\wordpress\wp-admin\includes\template.php:2348 [22-Jun-2021 18:48:02 UTC] PHP 11. WP_Hook->apply_filters() C:\wamp64\www\wordpress\wp-includes\plugin.php:212 [22-Jun-2021 18:48:02 UTC] PHP 12. Mgsisk\Webcomic\Collection\hook_add_post_media_states() C:\wamp64\www\wordpress\wp-includes\class-wp-hook.php:294 [22-Jun-2021 18:48:02 UTC] PHP Warning: array_unique() expects parameter 1 to be array, bool given in C:\wamp64\www\wordpress\wp-content\plugins\webcomic\lib\collection\settings\general.php on line 329 [22-Jun-2021 18:48:02 UTC] PHP Stack trace: [22-Jun-2021 18:48:02 UTC] PHP 1. {main}() C:\wamp64\www\wordpress\wp-admin\customize.php:0 [22-Jun-2021 18:48:02 UTC] PHP 2. do_action() C:\wamp64\www\wordpress\wp-admin\customize.php:281 [22-Jun-2021 18:48:02 UTC] PHP 3. WP_Hook->do_action() C:\wamp64\www\wordpress\wp-includes\plugin.php:484 [22-Jun-2021 18:48:02 UTC] PHP 4. WP_Hook->apply_filters() C:\wamp64\www\wordpress\wp-includes\class-wp-hook.php:316 [22-Jun-2021 18:48:02 UTC] PHP 5. WP_Customize_Manager->customize_pane_settings() C:\wamp64\www\wordpress\wp-includes\class-wp-hook.php:292 [22-Jun-2021 18:48:02 UTC] PHP 6. WP_Customize_Background_Image_Control->json() C:\wamp64\www\wordpress\wp-includes\class-wp-customize-manager.php:4969 [22-Jun-2021 18:48:02 UTC] PHP 7. WP_Customize_Background_Image_Control->to_json() C:\wamp64\www\wordpress\wp-includes\class-wp-customize-control.php:336 [22-Jun-2021 18:48:02 UTC] PHP 8. wp_prepare_attachment_for_js() C:\wamp64\www\wordpress\wp-includes\customize\class-wp-customize-upload-control.php:61 [22-Jun-2021 18:48:02 UTC] PHP 9. get_media_states() C:\wamp64\www\wordpress\wp-includes\media.php:4126 [22-Jun-2021 18:48:02 UTC] PHP 10. apply_filters() C:\wamp64\www\wordpress\wp-admin\includes\template.php:2348 [22-Jun-2021 18:48:02 UTC] PHP 11. WP_Hook->apply_filters() C:\wamp64\www\wordpress\wp-includes\plugin.php:212 [22-Jun-2021 18:48:02 UTC] PHP 12. Mgsisk\Webcomic\Collection\Settings\hook_add_collection_media_state() C:\wamp64\www\wordpress\wp-includes\class-wp-hook.php:294 [22-Jun-2021 18:48:02 UTC] PHP 13. array_unique() C:\wamp64\www\wordpress\wp-content\plugins\webcomic\lib\collection\settings\general.php:329
Forum: Plugins
In reply to: [Webcomic] WordPress Customizer Doesn’t Work When Webcomic is EnabledI was having the same error, what I found was that when I add a background image on my theme (ePorfolio) the customizer would break if the webcomics plugin enabled. my image is a png so maybe the file format is the issue but not sure.