Please add filters so that we can dynamically modify the options
-
Hi,
I am also the developer of many plugins available on this repository. I have no technical issue with your plugins, but I think something is missing. I modified the code for myself, but I think it should also be included in the public version.
My headers are different in the pages and in the posts. Unfortunately, the settings of your plugin are global, and settings can’t be modified.
Therefore, I modified your plugin so that the settings can be filtered and modified, this way:
'margin_top' => apply_filters( 'q2w3_margin_top', $options['margin-top'] ), 'margin_bottom' => apply_filters( 'q2w3_margin_bottom', $options['margin-bottom'] ),
That allows me to do things in my own custom code:
add_filter( 'q2w3_margin_top', function ( $margin_top ) { return is_singular( 'post' ) ? ( $margin_top - 90 ) : $margin_top; }, 10, 2 );
This way, everything is perfect. Could you add this into the next version? I would rather keep your plugin with its updates, than keeping my own fork of it.
Thank you ??
- The topic ‘Please add filters so that we can dynamically modify the options’ is closed to new replies.