mrprainx
Forum Replies Created
-
Forum: Plugins
In reply to: [Calculated Fields Form] Daily updatesThank you @codepeople.
I’m happy to hear that. I just thought I was facing some kind of “bug”, pushing updates everyday. But if they are real updates, I’m very happy to install them everyday! ??
Thank you again.
Forum: Plugins
In reply to: [Calculated Fields Form] Daily updatesHello everyone. Any news about this issue?
I’m still having daily updates.
Thank you.
Forum: Developing with WordPress
In reply to: How to show a shortcode “inline” with the textI know I was missing something very basic. Eheh.
Thank you again.
Forum: Developing with WordPress
In reply to: How to show a shortcode “inline” with the textGreat! Thank you Steve!
Forum: Plugins
In reply to: [The Events Calendar] Shortcode with tribe_get_start_date()Update:
I’ve just read that there is a specific way to get post data for Post Grid of Visual Composer. That’s why post ID wasn’t “passed” to the function.
- https://kb.wpbakery.com/docs/developers-how-tos/adding-custom-shortcode-to-grid-builder/
- https://stackoverflow.com/questions/31196353/wordpress-getting-post-data-for-post-grid-of-visual-composer
Following this two guides I’ve managed to have the event start date in the right way.
Thank you.
Forum: Plugins
In reply to: [The Events Calendar] Shortcode with tribe_get_start_date()EDIT:
Following this guide, I’ve updated the code as follows:
// Add Shortcode For Event Date function start_date_shortcode() { // Ensure the global $post variable is in scope global $post; // Retrieve events $events = tribe_get_events(); // Loop through the events: set up each one as // the current post then use template tags to // display the start date date foreach ( $events as $post ) { setup_postdata( $post ); echo tribe_get_start_date( $post, false, 'j M, Y - \h H:i' ) . '<br/>'; } } add_shortcode('start-date', 'start_date_shortcode');
But I still get the list of all events’ start date.
Forum: Plugins
In reply to: [The Events Calendar] Shortcode with tribe_get_start_date()Hello Ed.
This helped a lot! Thank you!
I’ve updated the code as follows:
// Add Shortcode For Event Date function start_date_shortcode() { $events = tribe_get_events(); foreach( $events as $event ) { echo tribe_get_start_date( $event, false, 'j M, Y - g:i A'); } } add_shortcode('start-date', 'start_date_shortcode');
The issue now is that it’s showing the date of all the events, not just one. As you can see in the screenshot, I have 2 events; the shortcode is now showing the start date of both:
What am I missing?
Forum: Plugins
In reply to: [The Events Calendar] Shortcode with tribe_get_start_date()EDIT:
I’ve fixed the code as follows:
// Add Shortcode For Event Date function start_date_shortcode() { global $post return tribe_get_start_date( $post->id, false, 'F j, Y - g:i a'); } add_shortcode('start-date', 'start_date_shortcode');
But it doesn’t work.
Forum: Fixing WordPress
In reply to: Pass an email address from one form to anotherFor users who are looking for the same solution.
I’ve managed to have this working by:
- Create a shortcode as suggested by Steve as follows:
// Add Shortcode function newsletter_form() { return htmlspecialchars($_POST['email']); } add_shortcode( 'newsletter-form', 'newsletter_form' );
- Add a filter in the functions.php file to use shortcodes inside <input> HTML tag, namely in the VALUE attribute as follows:
// shortcodes in html add_filter( 'wp_kses_allowed_html', function ( $allowedposttags, $context ) { if ( $context == 'post' ) { $allowedposttags['input']['value'] = 1; } return $allowedposttags; }, 10, 2 );
I found this solution here
- Edit the email field of the form as follows:
<input type="text" name="email" id="email" value="[newsletter-form]" style="padding: 10px 2%; width: 90%; min-width: auto; color:#000000;">
Hope this helps.
- This reply was modified 6 years, 4 months ago by mrprainx.
Forum: Fixing WordPress
In reply to: Pass an email address from one form to anotherThank you Steve.
I will use
<?php echo htmlspecialchars($_POST['email']); ?>
to avoid XSS. Thank you for pointing this out.And I will give a try in using shortcode.
Thank you again.
- This reply was modified 6 years, 4 months ago by mrprainx.
Forum: Plugins
In reply to: [Contact Form 7] 2 acceptances: 1 mandatory, the other optionalThat was so easy! Sorry for this dumb question.
To be honest, I’ve tried that before asking the question, but I wrote the
optional
option in the wrong place of the tags… ??Thank you Takayuki.
Have a nice day.
- This reply was modified 6 years, 4 months ago by mrprainx.
Forum: Plugins
In reply to: [Custom Post Type UI] Unable to delete a custom taxonomyYes I was, actually!
Thank you Michael.
I had some lines for the taxonomy in the functions.php file that I totally forgot about.
Thank you again.
Best regards.
Forum: Plugins
In reply to: [Custom Post Type UI] Unable to delete a custom taxonomyHere it is:
{"paesi":{"name":"paesi","label":"Paesi","singular_label":"Paese","description":"","public":"true","hierarchical":"true","show_ui":"true","show_in_menu":"true","show_in_nav_menus":"true","query_var":"true","query_var_slug":"","rewrite":"true","rewrite_slug":"","rewrite_withfront":"1","rewrite_hierarchical":"0","show_admin_column":"false","show_in_rest":"false","show_in_quick_edit":"","rest_base":"","labels":{"menu_name":"","all_items":"","edit_item":"","view_item":"","update_item":"","add_new_item":"","new_item_name":"","parent_item":"","parent_item_colon":"","search_items":"","popular_items":"","separate_items_with_commas":"","add_or_remove_items":"","choose_from_most_used":"","not_found":"","no_terms":"","items_list_navigation":"","items_list":""},"object_types":["causes"]},"settori":{"name":"settori","label":"Settori","singular_label":"Settore","description":"","public":"true","hierarchical":"true","show_ui":"true","show_in_menu":"true","show_in_nav_menus":"true","query_var":"true","query_var_slug":"","rewrite":"true","rewrite_slug":"","rewrite_withfront":"1","rewrite_hierarchical":"0","show_admin_column":"false","show_in_rest":"false","show_in_quick_edit":"","rest_base":"","labels":{"menu_name":"","all_items":"","edit_item":"","view_item":"","update_item":"","add_new_item":"","new_item_name":"","parent_item":"","parent_item_colon":"","search_items":"","popular_items":"","separate_items_with_commas":"","add_or_remove_items":"","choose_from_most_used":"","not_found":"","no_terms":"","items_list_navigation":"","items_list":""},"object_types":["causes"]}}
Hello Joey. Sorry for late reply.
Yes! This definitely helps. Thank you very much!
I would give it a try.
PS. I was sure to find some useful plugin to achieve this, but this is not the case apparently!
Thank you Michael!
Great assistance.