Plugin Directory

Changeset 2842798


Ignore:
Timestamp:
01/03/2023 12:39:59 PM (3 years ago)
Author:
therightsw
Message:

Updated to latest Wordpress, Added support for Elementor Widgets

Location:
cta-builder
Files:
6 added
7 edited

Legend:

Unmodified
Added
Removed
  • cta-builder/trunk/assets/css/main-style.css

    r2682187 r2842798  
    2323}
    2424}
     25
     26
     27/* style for widget banner_size */
     28.banner {
     29    width: 100%;
     30}
     31@media only screen and (min-width: 786px) {
     32.banner[data-banner-size="box"] {
     33    width: 500px;
     34}
     35}
     36
     37.banner[data-banner-size="full_width"] {
     38    width: 100%;
     39    max-width: none;
     40}
     41
     42
     43/* syle for widget banner_position */
     44
     45.banner {
     46    /* default position and size */
     47    position: relative;
     48    top: 0;
     49    left: 0;
     50    width: 100%;
     51    height: 100%;
     52
     53    /* other styles for the banner */
     54    background-color: #fff;
     55    text-align: center;
     56}
     57
     58.banner[data-banner-position="top left"] {
     59    top: 50%;
     60    left: 0;
     61    transform: translateY(-50%);
     62}
     63
     64.banner[data-banner-position="top center"] {
     65    top: 50%;
     66    left: 50%;
     67    transform: translate(-50%, -50%);
     68}
     69
     70.banner[data-banner-position="top right"] {
     71    top: 0;
     72    right: 0;
     73    left: 50%;
     74}
     75
     76.banner[data-banner-position="center left"] {
     77    top: 50%;
     78    left: 0;
     79    transform: translateY(-50%);
     80}
     81
     82.banner[data-banner-position="center center"] {
     83    top: 0;
     84    left: 50%;
     85    transform: translateX(-50%);
     86}
     87
     88.banner[data-banner-position="center right"] {
     89    top: 50%;
     90    right: 0;
     91    left: 50%;
     92    transform: translateY(-50%);
     93}
     94
     95.banner[data-banner-position="bottom left"] {
     96    bottom: 0;
     97    left: 0;
     98}
     99
     100.banner[data-banner-position="bottom center"] {
     101    bottom: 0;
     102    left: 50%;
     103    transform: translateX(-50%);
     104}
     105
     106.banner[data-banner-position="bottom right"] {
     107    bottom: 0;
     108    right: 0;
     109    left: 50%;
     110}
  • cta-builder/trunk/includes/trs_create_meta_boxes.php

    r2682187 r2842798  
    11<?php
     2
    23/**
    34 * Create the metabox
    45 */
    5  if(!function_exists('trs_cta_create_metabox')){
    6 function trs_cta_create_metabox() {
    7    
    8      add_meta_box(
    9         'cta_banner_size_metabox', // Metabox ID
    10         'Banner Sizes', // Title to display
    11         'trs_cta_banner_sizes_render_metabox', // Function to call that contains the metabox content
    12         'cta', // Post type to display metabox on
    13         'normal', // Where to put it (normal = main colum, side = sidebar, etc.)
    14         'default' // Priority relative to other metaboxes
    15     );
     6if (!function_exists('trs_cta_create_metabox')) {
     7    function trs_cta_create_metabox()
     8    {
    169
    17      add_meta_box(
    18         'cta_image_properties_metabox', // Metabox ID
    19         'Banner Image Properties', // Title to display
    20         'trs_cta_image_properties_render_metabox', // Function to call that contains the metabox content
    21         'cta', // Post type to display metabox on
    22         'normal', // Where to put it (normal = main colum, side = sidebar, etc.)
    23         'default' // Priority relative to other metaboxes
    24     );
    25    
    26        add_meta_box(
    27         'cta_text_properties_metabox', // Metabox ID
    28         'Banner Text Properties', // Title to display
    29         'trs_cta_text_properties_render_metabox', // Function to call that contains the metabox content
    30         'cta', // Post type to display metabox on
    31         'normal', // Where to put it (normal = main colum, side = sidebar, etc.)
    32         'default' // Priority relative to other metaboxes
    33     );
     10        add_meta_box(
     11            'cta_banner_size_metabox', // Metabox ID
     12            'Banner Sizes', // Title to display
     13            'trs_cta_banner_sizes_render_metabox', // Function to call that contains the metabox content
     14            'cta', // Post type to display metabox on
     15            'normal', // Where to put it (normal = main colum, side = sidebar, etc.)
     16            'default' // Priority relative to other metaboxes
     17        );
    3418
    35          add_meta_box(
    36         'cta_shortcode_metabox', // Metabox ID
    37         'Shortcode', // Title to display
    38         'trs_cta_shortcode_render_metabox', // Function to call that contains the metabox content
    39         'cta', // Post type to display metabox on
    40         'side', // Where to put it (normal = main colum, side = sidebar, etc.)
    41         'default' // Priority relative to other metaboxes
    42     );
     19        add_meta_box(
     20            'cta_image_properties_metabox', // Metabox ID
     21            'Banner Image Properties', // Title to display
     22            'trs_cta_image_properties_render_metabox', // Function to call that contains the metabox content
     23            'cta', // Post type to display metabox on
     24            'normal', // Where to put it (normal = main colum, side = sidebar, etc.)
     25            'default' // Priority relative to other metaboxes
     26        );
     27
     28        add_meta_box(
     29            'cta_text_properties_metabox', // Metabox ID
     30            'Banner Text Properties', // Title to display
     31            'trs_cta_text_properties_render_metabox', // Function to call that contains the metabox content
     32            'cta', // Post type to display metabox on
     33            'normal', // Where to put it (normal = main colum, side = sidebar, etc.)
     34            'default' // Priority relative to other metaboxes
     35        );
     36
     37        add_meta_box(
     38            'cta_shortcode_metabox', // Metabox ID
     39            'Shortcode', // Title to display
     40            'trs_cta_shortcode_render_metabox', // Function to call that contains the metabox content
     41            'cta', // Post type to display metabox on
     42            'side', // Where to put it (normal = main colum, side = sidebar, etc.)
     43            'default' // Priority relative to other metaboxes
     44        );
     45    }
     46    add_action('add_meta_boxes', 'trs_cta_create_metabox');
    4347}
    44 add_action( 'add_meta_boxes', 'trs_cta_create_metabox' );
    45  }
  • cta-builder/trunk/includes/trs_cta_banner_sizes_render_metabox.php

    r2682187 r2842798  
    6868
    6969    /**
    70    
    71     /**
    7270     * Sanitize the submitted data
    7371     * This keeps malicious code out of our database.
  • cta-builder/trunk/includes/trs_cta_shortcode_render_metabox.php

    r2682187 r2842798  
    11<?php
     2
    23/**
    34 * Render the Shortcode metabox markup
    45 */
    5  if(!function_exists('trs_cta_shortcode_render_metabox')){
    6 function trs_cta_shortcode_render_metabox() {
    7     // Variables
    8     global $post;
     6if (!function_exists('trs_cta_shortcode_render_metabox')) {
     7    function trs_cta_shortcode_render_metabox()
     8    {
     9        // Variables
     10        global $post;
    911?>
    1012        <!-- Banner Size Field -->
    11           <fieldset>
    12             <div class="bannerSizesField banneField">
    13             <label for="shortcode_metabox"></label>
     13        <fieldset>
     14            <div class="bannerSizesField banneField">
     15                <label for="shortcode_metabox"></label>
     16                <?php
     17                if ('publish' === esc_attr(get_post_status($post->ID))) {
     18                ?>
     19                    <p>[trs_cta_banner id="<?php echo esc_attr($post->ID); ?>"]</p>
     20                <?php
     21                }
     22                ?>
     23            </div>
     24        </fieldset>
    1425<?php
    15             if( 'publish' === esc_attr( get_post_status( $post->ID ))){
    16 ?>
    17                 <p>[trs_cta_banner id="<?php echo esc_attr( $post->ID );?>"]</p>
    18 <?php
    19             }
    20 ?>           
    21             </div>
    22         </fieldset>
    23 <?php
    24         }
    25             }
     26    }
     27}
  • cta-builder/trunk/includes/trs_shortcode.php

    r2682187 r2842798  
    3636            <!-- Main DIV for style -->
    3737            <div class="cta-section default-size" style="
    38             background: url('<?php echo esc_attr( get_the_post_thumbnail_url( $post->ID ) )?>');
     38            background: url(<?php echo get_post_meta( get_the_ID(), 'cta_banner_url', true ); ?>);
    3939            background-color: <?php echo esc_attr( get_post_meta($post->ID, 'cta_bg_color', true ) );?>;
    4040            border: <?php echo esc_attr( get_post_meta($post->ID, 'cta_border', true ) ).' '.esc_attr( get_post_meta($post->ID, 'cta_border_color', true ) ) ;?>;
  • cta-builder/trunk/readme.txt

    r2697008 r2842798  
    1 === Call-to-action Builder===
     1=== Call To Action Builder===
    22Contributors: therightsw, muhammad-jamil-baig
    33Donate link: https://therightsw.com/
    44Tags: banner, cta, call-to-action, images, page, links, fonts, colors, shortcode, click, count, heading, sub-heading
    55Requires at least: 5.2
    6 Tested up to: 5.9
    7 Stable tag: 1.0
     6Tested up to: 6.1
     7Stable tag: 1.1
    88Requires PHP: 7.2
    99License: GPLv2 or later
     
    1515CTA (call-to-action) Builder plugin allows you to create HTML5 clickable banners and add to your pages with shortcode. It is user friendly. User can set heading & sub-heading text, User can set font size, font color, text alignment, font family, image size, image position, border, border color, background color. This plugin will generate a shortcode which can be used in any page or template. Shows number of clicks in admin.
    1616
     17Every self-respected businessman should have an elegant and colorful banner on website to attract more customers. With the Banner widget of the Call To Action plugin, you will be able to display all the information you need with a background image in just a few clicks.Moreover You can add backgorund color for banner If you don't want to insert banner image.
     18
     19Step 1 — Add the Banner widget ot the page
     20
     21Open your website’s dashboard and find the page where you want to place a banner. Use the search field at the top to locate the Banner widget when you open it in the Elementor page builder. Drag & drop it to the desired location on the page.
     22
     23Step 2 — Choose the content and define settings
     24
     25Open the Content menu tab in the left-side menu, then expand the Content section.
     26
     27Let's look over the features this section has to offer:
     28
     29* Banner Size. you can select banner size here from drop down.
     30* Bannere Position. You can select banner posiyion here from drop down.
     31* Image. The background image from your media library can be chosen here.
     32* Image Size.  The size of the image can be selected from this drop down menu.
     33* Heading. The text you enter here will appear above the banner image as a title.
     34* Sub Heading. You can insert an explanation or notification here if the banner needs it. Along with the image, the text will be displayed over the banner image.
     35* Link.If your banner is supposed to lead the user to a certain page insert the link to it here
     36
     37The last step is to style your banner up. Proceed to the Style tab and create your perfect banner design.
     38
    1739For more info about WordPress plugin development, visit The Right Software [plugin development services](https://therightsw.com/plugin-development/) page.
    1840View other [WordPress Plugins](https://profiles.wordpress.org/therightsw/#content-plugins).
    1941Send your problems to [hello@therightsw.com](mailto:hello@therightsw.com). Dont forget to mention WordPress and WooCommerce versions.
    2042
    21 Tested on WP 5.9
     43Tested on WP 6.1
    2244
    23 = Version 1.0 =
    24 * Initial Plugin Release
     45= Version 1.1 =
     46* Updated Plugin Release
    2547
    2648== Installation ==
  • cta-builder/trunk/trs_cta_builder.php

    r2697007 r2842798  
    11<?php
     2
    23/**
    3  * Plugin Name:       CTA Builder
     4 * Plugin Name:       Call To Action
    45 * Plugin URI:        https://therightsw.com/plugin-development/
    56 * Description:       This **TRS CTA Builder** call-to-action plugin allows you to create HTML5 clickable banners and add to your pages with shortcode. It is user friendly. User can set heading & sub-heading text, User can set font size, font color, text alignment, font family, image size, image position, border, border color, background color. This plugin will generate a shortcode which can be used in any page or template. Shows number of clicks in admin.
    6  * Version:           1.0
     7 * Version:           1.1
    78 * Requires at least: 5.2
    89 * Requires PHP:      7.2
     
    1011 * Author URI:        https://therightsw.com/plugin-development/
    1112 * License:           GPL v2 or later
     13 * Text Domain:       Call To Action
    1214 */
    13  
    14 include( plugin_dir_path( __FILE__ ) . 'trs_cta_activate.php');
    1515
    16 include( plugin_dir_path( __FILE__ ) . 'includes/trs_cta_post_type.php');
     16include(plugin_dir_path(__FILE__) . 'trs_cta_activate.php');
    1717
    18 include( plugin_dir_path( __FILE__ ) . 'functions.php');
     18include(plugin_dir_path(__FILE__) . 'includes/trs_cta_post_type.php');
    1919
    20 include( plugin_dir_path( __FILE__ ) . 'includes/trs_create_meta_boxes.php');
     20include(plugin_dir_path(__FILE__) . 'functions.php');
    2121
    22 include( plugin_dir_path( __FILE__ ) . 'includes/trs_cta_image_properties_render_metabox.php');
     22include(plugin_dir_path(__FILE__) . 'includes/trs_create_meta_boxes.php');
    2323
    24 include( plugin_dir_path( __FILE__ ) . 'includes/trs_cta_text_properties_render_metabox.php');
     24include(plugin_dir_path(__FILE__) . 'includes/trs_cta_image_properties_render_metabox.php');
    2525
    26 include( plugin_dir_path( __FILE__ ) . 'includes/trs_cta_banner_sizes_render_metabox.php');
     26include(plugin_dir_path(__FILE__) . 'includes/trs_cta_text_properties_render_metabox.php');
    2727
    28 include( plugin_dir_path( __FILE__ ) . 'includes/trs_cta_shortcode_render_metabox.php');
     28include(plugin_dir_path(__FILE__) . 'includes/trs_cta_banner_sizes_render_metabox.php');
    2929
    30 include( plugin_dir_path( __FILE__ ) . 'includes/trs_shortcode.php');
     30include(plugin_dir_path(__FILE__) . 'includes/trs_cta_shortcode_render_metabox.php');
    3131
    32 include( plugin_dir_path( __FILE__ ) . 'includes/trs_cta_counter.php');
     32include(plugin_dir_path(__FILE__) . 'includes/trs_shortcode.php');
    3333
    34 include( plugin_dir_path( __FILE__ ) . 'trs_cta_uninstall.php');
     34include(plugin_dir_path(__FILE__) . 'includes/trs_cta_counter.php');
     35
     36include(plugin_dir_path(__FILE__) . 'trs_cta_uninstall.php');
     37
     38include(plugin_dir_path(__FILE__) . 'includes/trs_cta_register_widget.php');
Note: See TracChangeset for help on using the changeset viewer.