• It seems that when you tick ‘Make exception rule available to individual posts and tags’, when the widget’s listed in the metabox on the post edit screen, it’s not possible to tell at a glance between different widgets of the same type.

    I realise this is because there’s no required field for widgets, so there’s nothing like ‘title’ which you’d be able to use for distinguishing between widget instances.

    However, I wonder if you could add a simple filter (dynamic-widgets.php, line 353, around the call to getName). If you pass the widget, developers would be able to add hook in their own code to output identifying fields for widgets.

    Is there any chance of something like this being added? Or is there maybe another method I’m missing?

    https://www.ads-software.com/plugins/dynamic-widgets/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Contributor Qurl

    (@qurl)

    Yes, this is a known problem. A request has been made a long time ago to be able to add some sort of comment that is shown in the post meta box also to distinguish.

    Adding a filter is indeed also a solution that would work. And I have to say much easier. ?? However, this will only work for developers of course.

    Thread Starter Steve Taylor

    (@gyrus)

    Any chance of a filter being added soon, then a non-dev-friendly solution being added as time permits? I would have submitted a pull request if the code was on GitHub, it’s such a simple change.

    Plugin Contributor Qurl

    (@qurl)

    I don’t expect a new release soon, but I can add this of course quite quickly to the development version.

    Thread Starter Steve Taylor

    (@gyrus)

    Thanks. Can you guarantee that even if the new release isn’t out for a while, that this change will be in it? That will mean I can hack our installed version and rest assured it will still work when the new update gets applied (I manage our sites en mass remotely).

    Also, I guess the specifics of the implementation will matter, to not break my hook. I’m thinking something like this:

    echo '<input type="checkbox" id="dw_' . $widget->widget_id . '" name="dw-single-post[]" value="' . $widget->widget_id . '"' . $checked . ' /> <label for="dw_' . $widget->widget_id . '">' . apply_filters( 'dynwid_post_control_label', $DW->getName($widget->widget_id) . __(' (Default: ', DW_L10N_DOMAIN) . $default . ')', $widget, $default ) . '</label><br />';

    But actually I’m not sure – finding it hard to get the instance’s settings from $widget.

    Plugin Contributor Qurl

    (@qurl)

    When I add it to the development version it’s checked in to the repository. Only way to remove it then is to deliberately removing it.

    Thread Starter Steve Taylor

    (@gyrus)

    OK. Just wondering about how to implement it now by hacking my site’s copy, then not have it overwritten by a different implementation when the official version’s released. Any ideas?

    Plugin Contributor Qurl

    (@qurl)

    I’ll let you know what I’ve done when I’ve added it to the code. Then you can anticipate on it. ??

    Thread Starter Steve Taylor

    (@gyrus)

    Um, when the code’s added I won’t have to anticipate it! I was hoping to be able to add the fix for a current project which is about to launch. However, I respect that you may not have time to attend to it so quickly. Let me know when it’s ready, thanks.

    Thread Starter Steve Taylor

    (@gyrus)

    Hi there, any advance on this?

    Plugin Contributor Qurl

    (@qurl)

    I’m actually planing to schedule some work for DW. It’s been laying untouched way to long. Mainly cause of commercial projects I’ve been working on the last months. (I have to eat and my bank expects my mortgage every month). One of the things on the list is this. My apologies for the delay.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Distinguish between different widgets of same type in post edit screen metabox’ is closed to new replies.