ElementInvader Addons for Elementor Shortcodes

Below, you’ll find a detailed guide on how to add the ElementInvader Addons for Elementor Shortcodes to your WordPress website, including their parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the ElementInvader Addons for Elementor Plugin shortcodes not to show or not to work correctly.

Before starting, here is an overview of the ElementInvader Addons for Elementor Plugin and the shortcodes it provides:

Plugin Icon
ElementInvader Addons for Elementor

"ElementInvader Addons for Elementor is a powerful WordPress plugin, enhancing your site design by adding more functionalities to the Elementor page builder. Boost your creativity with this comprehensive tool."

★★★★★ (1) Active Installs: 3000+ Tested with: 6.3.2 PHP Version: 5.6
Included Shortcodes:
  • [eli_option_value]
  • [eli-newsletter]

ElementInvader Addons for Elementor [eli_option_value] Shortcode

The ElementInvader Addons for Elementor plugin shortcode, ‘eli_option_value’, retrieves and stores a specific option’s value. This shortcode allows you to access the value multiple times without re-querying the database. The shortcode takes two attributes: ‘option’ and ‘reset’. ‘Option’ specifies the option to get the value from, and ‘reset’ allows you to clear all the stored values. The function first checks if the value is stored in a static variable. If not, it fetches the value from the database.

Shortcode: [eli_option_value]

Parameters

Here is a list of all possible eli_option_value shortcode parameters and attributes:

  • option – The name of the specific option value to retrieve.
  • reset – If set to 1, it resets all saved option values to default.

Examples and Usage

Basic example – The shortcode can be used to retrieve a specific option value. In the example below, we’re retrieving the value of the ‘blogname’ option.

[eli_option_value option="blogname"]

Advanced examples

Here, we’re using the shortcode to retrieve a theme modification value. If the ‘color_scheme’ mod exists, its value will be displayed.

[eli_option_value option="color_scheme"]

In this example, we’re using the shortcode to reset the saved options. By setting the ‘reset’ attribute to ‘1’, all saved options will be cleared.

[eli_option_value option="blogname" reset="1"]

This is an example of using the shortcode to retrieve a blog information value. In this case, the ‘description’ of the blog is being retrieved.

[eli_option_value option="blogdescription"]

PHP Function Code

In case you have difficulties debugging what causing issues with [eli_option_value] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('eli_option_value', 'eli_option_value');

Shortcode PHP function:

                    function eli_option_value($atts){
    $atts = shortcode_atts(array(
        'option'=>'',
        'reset'=>'',
    ), $atts);

    static $options_value = array();

    if($atts['reset'] == 1) {
        $options_value = array();
    }

    $value = false;

    /* first check from static var */
    if(isset($options_value [$atts['option']])) {
        $value = $options_value [$atts['option']];
    } else if(substr($atts['option'], 0, 4) == 'blog') {
        $options_value [$atts['option']] = $value = get_bloginfo( $atts['option']);
    } else if($value = get_option($atts['option'])) {
        $options_value [$atts['option']] = $value;
    } else if($value = get_theme_mod($atts['option'])) {
        $options_value [$atts['option']] = $value;
    }

    return $value;
}
                    

Code file location:

elementinvader-addons-for-elementor/elementinvader-addons-for-elementor/shortcodes/shortcode-eli_option_value.php

ElementInvader Addons for Elementor [eli-newsletter] Shortcode

The Element Invader Addons for Elementor ‘eli-newsletter’ shortcode creates a customizable newsletter form. It pulls default email data from the blog’s admin settings and can be integrated with reCAPTCHA for security. The shortcode allows disabling mail send, setting custom subjects, and can utilize MailChimp’s API for advanced mailing options. This flexible tool is ideal for user engagement via newsletters.

Shortcode: [eli-newsletter]

Parameters

Here is a list of all possible eli-newsletter shortcode parameters and attributes:

  • id – Unique identifier for the newsletter form.
  • custom_class – Custom CSS class for styling the form.
  • disable_mail_send – If set, email sending is disabled.
  • mail_data_subject – Subject for the outgoing email.
  • mail_data_from_email – Sender’s email address.
  • mail_data_from_name – Name of the email sender.
  • mail_data_to_email – Recipient’s email address.
  • recaptcha_site_key – Site key for Google reCAPTCHA.
  • recaptcha_secret_key – Secret key for Google reCAPTCHA.
  • section_send_action_mailchimp_api_key – API key for Mailchimp integration.
  • section_send_action_mailchimp_list_id – Mailchimp list ID for subscriber addition.
  • send_action_type – Defines the method of sending the email.

Examples and Usage

Basic example – A simple usage of the ‘eli-newsletter’ shortcode with the ‘id’ attribute.

[eli-newsletter id=1 /]

Advanced examples

Using the shortcode with multiple attributes. This example includes ‘id’, ‘custom_class’, and ‘disable_mail_send’ attributes. The ‘id’ attribute is used to specify the newsletter, ‘custom_class’ is used to add a custom CSS class, and ‘disable_mail_send’ is used to disable the sending of the newsletter email.

[eli-newsletter id=1 custom_class="my_custom_class" disable_mail_send=true /]

Another advanced usage of the shortcode with ‘mail_data_subject’, ‘mail_data_from_email’, and ‘mail_data_to_email’ attributes. These attributes are used to customize the email subject, sender’s email, and recipient’s email respectively.

[eli-newsletter id=1 mail_data_subject="My Newsletter" mail_data_from_email="sender@example.com" mail_data_to_email="recipient@example.com" /]

Using the shortcode with ‘recaptcha_site_key’ and ‘recaptcha_secret_key’ attributes. These attributes are used to integrate Google reCAPTCHA for spam protection.

[eli-newsletter id=1 recaptcha_site_key="your_site_key" recaptcha_secret_key="your_secret_key" /]

Using the shortcode with ‘section_send_action_mailchimp_api_key’ and ‘section_send_action_mailchimp_list_id’ attributes. These attributes are used to integrate the newsletter with MailChimp.

[eli-newsletter id=1 section_send_action_mailchimp_api_key="your_api_key" section_send_action_mailchimp_list_id="your_list_id" /]

PHP Function Code

In case you have difficulties debugging what causing issues with [eli-newsletter] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode('eli-newsletter', 'eli_shortcode_newsletter');

Shortcode PHP function:

                    function eli_shortcode_newsletter($atts, $content){
    $atts = shortcode_atts(array(
        'id'=>NULL,
        'custom_class'=>'',
        'disable_mail_send'=>'',
        'mail_data_subject'=>esc_html__('Newsletter', 'elementinvader-addons-for-elementor'),
        'mail_data_from_email'=>get_bloginfo('admin_email'),
        'mail_data_from_name'=>get_bloginfo('admin_email'),
        'mail_data_to_email'=>get_bloginfo('admin_email'),
        'recaptcha_site_key'=>'',
        'recaptcha_secret_key'=>'',
        'section_send_action_mailchimp_api_key'=>'',
        'section_send_action_mailchimp_list_id'=>'',
        'send_action_type'=>'mail_base',
    ), $atts);
    $data = array();

    /* settings from atts */
    $data['settings'] = $atts;
    $data['id_element'] = '';

    /* load css/js */

    return eli_shortcodes_view('shortcode-newsletter', $data);
}
                    

Code file location:

elementinvader-addons-for-elementor/elementinvader-addons-for-elementor/shortcodes/shortcode-newsletter.php

Conclusion

Now that you’ve learned how to embed the ElementInvader Addons for Elementor Plugin shortcodes, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *