• Resolved daricedotorg

    (@daricedotorg)


    I’d like to disable to shortcode while keeping the plugin active. We use it more in the admin to keep track of the credits. On the frontend, it does not work flawlessly as it tends to limit the image in width.

    I tried the code (found in the FAQ) in functions.php to disable the shortcode. But the shortcode still shows.

    Is there a way to just have media credits active in the admin and not in the posts?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author pepe

    (@pputzer)

    Hi @daricedotorg,

    the snippet in the FAQ only works when Media Credit is not activated on your site (otherwise it does nothing, as you have discovered). If you only need to disable the shortcode output on the frontend, you can use this filter:

    add_filter( 'media_credit_shortcode', function( $credit, $atts, $content ) { return $content; }, 10, 3 );

    As for the image width issue, you can disable the width forced onto the image caption/credit by returning zero from the img_caption_shortcode_width hook, e.g. using this snippet:

    add_filter( 'img_caption_shortcode_width', '__return_zero' );

    If it’s not that, could you describe the issues you encountered in more detail so that I can try to fix them in one of the next releases?

    Thread Starter daricedotorg

    (@daricedotorg)

    Thanks!

    As for the width issue. An editor would insert an image with media credit in the article with a 600px width for example. The original image is 1200px. The instruction is for them to insert it at at least 900px. Which often they don’t do.

    When I edit the article and click on the edit icon on the image to adjust the width in the custom width option. It doesn’t take. I have to remove the media credit tags for the new width to take. Probably because the media credit retains the previous width of 600px.

    Plugin Author pepe

    (@pputzer)

    I’ll look into it.

    Plugin Author pepe

    (@pputzer)

    Hi @daricedotorg, the width issue will be fixed in 4.2.0.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Disable shortcode but keep plugin active’ is closed to new replies.