• Resolved Steve Bruner

    (@sbruner)


    Your dashboard widget conflicts with WordPress Helpers:
    https://www.ads-software.com/plugins/wp-helpers/

    The widget assumes that you are on the DASHBOARD when checking for your widget, but WP Helpers also checks in the settings.

    Here’s a quick solution:

    IN THIS FILE: advanced-responsive-video-embedder/admin/class-advanced-responsive-video-embedder-admin.php

    FUNCTION: add_dashboard_widget()

    1) Add $pagenow as a global:
    global $wp_meta_boxes, $pagenow;

    2) Wrap your add code in a condition to check for index.php, all the way to the end of hte function.

    if($pagenow != 'index.php') {
     $normal_dashboard = $wp_meta_boxes['dashboard']['normal']['core'];

    With this solution your dashboard widget still works, but any plugins that check for those widgets won’t cause your plugin to throw a notice.

    https://www.ads-software.com/plugins/advanced-responsive-video-embedder/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Nico

    (@nico23)

    Well thanks for the “solution” but the code is actually for putting my widget at the very first in the dashboard. Your condition makes no sense to me because it actually prevents the code from running at the dashboard, the only place where its supposed to run.

    So a better workaround would be simply to remove the entire code used for rearranging the widget.

    You have not told me what exact conflict there is, what notice is shown or what actual functionality is broken. Maybe this issue should be fixed in the wp-helpers part, maybe not.

    I consider removing the code based on more information.

    Thread Starter Steve Bruner

    (@sbruner)

    Whoops! The condition should be==

    if($pagenow == 'index.php') {
     $normal_dashboard = $wp_meta_boxes['dashboard']['normal']['core'];

    WP Helpers pulls the list of Dashboard Widgets on its settings page, not the WP Dashboard. Your code throws a notice if $wp_meta_boxes[‘dashboard’] is called from any page besides index.php.

    Plugin Author Nico

    (@nico23)

    Ah OK thanks! Will include this in a upcoming version.

    With WP coding standards the condition will be.

    if( 'index.php' == $pagenow ) {

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Conflict with WordPress Helpers (and a solution)’ is closed to new replies.