- This topic has 15 replies, 3 voices, and was last updated 6 years ago by Tom.
-
AuthorPosts
-
July 29, 2016 at 12:26 am #213778Krzysztof
I try to save this copyright text:
Copyright %copy% 2009-%current_year% <a href="[:en]/en/about-me/[/:en][:pl]/pl/o-mnie[/:pl]">XYZ</a>
After refresh customize I see:
Copyright %copy% 2009-%current_year% <a href="pl]">XYZ</a>
I added such text a long time ago and it was work before copyright was moved to customize.July 29, 2016 at 1:03 am #213785KrzysztofSame is when I try to use others shortcodes.
July 29, 2016 at 9:41 am #213868TomLead DeveloperLead DeveloperInteresting – who supplies those shortcodes?
I’ve added sanitization for everything added to the database for security reasons, so it looks like the format of those shortcodes are being sanitized too heavily.
July 29, 2016 at 10:01 am #213884KrzysztofTom, those shortcodes are from “Ceceppa Multilingua” plugin. This same is for other shortcode from this plugin:
[cml_text lang1="value" lang2="value"]
which gives empty space.July 29, 2016 at 10:26 am #213906TomLead DeveloperLead DeveloperWhat happens when you add the shortcode, save and then view the site?
It’s possible that the live preview just isn’t firing the shortcode, but the live site will.
July 29, 2016 at 10:28 am #213908KrzysztofI don’t understand – such bug I have when I save and again go to customize. After save on front-end I have error in code.
July 29, 2016 at 10:32 am #213910TomLead DeveloperLead DeveloperYou may have to add it using a function then, as for whatever reason the Customizer isn’t liking the syntax of that shortcode.
add_action( 'generate_credits','generate_add_copyright_shortcodes' ); function generate_add_copyright_shortcodes() { echo do_shortcode( '[your_shortcode]' ); }
July 29, 2016 at 11:50 am #213950KrzysztofI can’t use it because then I can’t use %copy% and %current year%.
July 29, 2016 at 12:20 pm #213960TomLead DeveloperLead Developer%copy% coverts into
©
%current_year% converts into
<?php echo date( 'Y' ); ?>
July 30, 2016 at 12:09 am #214054KrzysztofTom maybe You can add filter to change copyright text (I would like to block changes in Customizer)?
July 30, 2016 at 8:38 am #214116TomLead DeveloperLead DeveloperI’ve made it so shortcodes are rendered in the live preview for the next version.
However, the syntax of the shortcodes in your initial post is really weird, so I’m not sure if it will work.
I’m not sure sure what you mean by block changes in the Customizer? You can add your own copyright message with whatever content you want using a function like this: https://generatepress.com/knowledgebase/changing-the-copyright/
July 30, 2016 at 8:42 am #214117KrzysztofBlock = no possibility to use Customize to change copyright text.
Syntax of this shortcodes is okay, I have problem not only with this shortcodes, this was only an example.
July 30, 2016 at 8:48 am #214121KrzysztofOkey, I used function to remove default message.
July 30, 2016 at 8:49 am #214122TomLead DeveloperLead DeveloperYou could do something like this to remove the customizer control:
add_action( 'after_setup_theme','generate_remove_copyright_control' ); function generate_remove_copyright_control() { remove_action( 'customize_register', 'generate_copyright_customize_register' ); }
March 28, 2018 at 7:58 am #533876DominiqueHi,
For information: I had exactly the same problem with the extension wp-multilang (a fork of qtranslate-x), the shortcodes to change languages ([:fr] [:en] [:]) were not interpreted in the footer.
I found a solution with the following code:add_filter( 'generate_copyright','tu_custom_copyright' ); function tu_custom_copyright() { switch (wpm_get_language()) { case 'fr': echo 'My Site Web © ' . date('Y') . ' - <a href="/fr/credits-et-mentions-legales/">Crédits et mentions légales</a>'; break; case 'en': echo 'My Site Web © ' . date('Y') . ' - <a href="/en/credits-et-mentions-legales/">Credits and legal notices</a>'; break; default: echo 'My Site Web © ' . date('Y') . ' - <a href="/fr/credits-et-mentions-legales/">Crédits et mentions légales</a>'; } }
If it can help someone with the same concern.
Dominik -
AuthorPosts
- You must be logged in to reply to this topic.