• Resolved awpdesigns

    (@awpdesigns)


    Hello, thank you very much for making this useful plugin.
    I wanna ask, how to change/remove (bs-) prefix in variables and tag attribute?
    Example attribute: “data-bs-toggle” to “data-toggle”.
    Thank you

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

    (@areoimiles)

    Hi @awpdesigns

    Thanks for reaching out and I’m glad to hear you’re finding our plugin useful!

    At the moment you can’t change the bs prefix for variables within the WP admin, however I can add this in no problem. It’s going to be a few weeks before the next update so in the meantime you can do the following to implement it yourself (until the update is released).

    Open the file located here /plugins/all-bootstrap-blocks/settings/customize/options.php and scroll to the bottom. You basically need to add a new option in for $variable-prefix so on line 176 do a line break after the comma and paste the below code in:

    array(
    		'label' => '$spacer',
    		'name' => $slug . 'spacer',
    		'variable' => '$spacer',
    		'row' => 'default',
    		'input' => 'text',
    		'default' => '1rem',
    		'description' => '',
    		'allow_reset' => true,
    		'options' => array()
    	),

    After you have done this you can login in to your WP admin and use the left hand menu: Bootstrap > Customize > Options then scroll down to the bottom and you should see the new setting for $variable-prefix. Change that to whatever you want and then click “Save & Recompile CSS”.

    In regards to changing the data attributes, I would strongly advise against this as it will have an impact on the Bootstrap JS and most likely stop dropdowns, modals, accordions, carousels etc working. That being said if you are adamant that you want to change it then you could add a function like the below to your functions.php file.

    add_filter( 'the_content', function( $content ) {
    	return str_replace( 'data-bs-', 'data-', $content );
    }, 100 );

    As I mentioned this will break the Bootstrap JS so you may need to look at a custom implementation of Bootstrap to resolve this.

    I hope this helps and if you have any other questions please don’t hesitate to get back in touch.

    Thanks
    Miles

    Thread Starter awpdesigns

    (@awpdesigns)

    Thankyou very much…. 🙏</img> it’s work!

    Plugin Author Miles

    (@areoimiles)

    Hi @awpdesigns

    Great! I’m glad that’s sorted for you. If you need any assistance in future please don’t hesitate to get back in touch.

    Thanks
    Miles

    P.S: if you like our plugin and are happy with the support we have provided, we would really appreciate it if you could take a few seconds to leave us a positive review.
    https://wordpress.org/support/plugin/all-bootstrap-blocks/reviews/#new-post

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Change/Remove Prefix’ is closed to new replies.