= 4.7 ) { $get_locale = get_user_locale(); } # Traditional WordPress plugin locale filter $locale = apply_filters( 'plugin_locale', $get_locale, 'accept-2checkout-payments-using-contact-form-7' ); $mofile = sprintf( '%1$s-%2$s.mo', 'accept-2checkout-payments-using-contact-form-7', $locale ); # Setup paths to current locale file $mofile_global = WP_LANG_DIR . '/plugins/' . basename( CF72CH_DIR ) . '/' . $mofile; if ( file_exists( $mofile_global ) ) { # Look in global /wp-content/languages/plugin-name folder load_textdomain( 'accept-2checkout-payments-using-contact-form-7', $mofile_global ); } else { # Load the default language files load_plugin_textdomain( 'accept-2checkout-payments-using-contact-form-7', false, $CF72CH_lang_dir ); } } } /** * CF7 plugin required error * * @method action__cf72ch_admin_notices_deactive * * @return string */ function action__cf72ch_admin_notices_deactive() { echo '
' . '

'. sprintf( __( 'Contact Form 7 is required to use %s.', 'accept-2checkout-payments-using-contact-form-7' ), 'Accept 2Checkout Payments using Contact Form 7' ) . '

'. '
'; } /** * Gnerare Tag in contact form 7 and validate,If license found then action run * * @method action__cf72ch_init * * @param object $contact_form */ function action__cf72ch_init() { /* Initialize backend tags */ add_action( 'wpcf7_admin_init', array( $this, 'action__cf72ch_admin_init' ), 15, 0 ); flush_rewrite_rules(); # Post Type: 2Checkout $labels = array( 'name' => __( '2Checkout Payment Details', 'accept-2checkout-payments-using-contact-form-7' ), 'singular_name' => __( '2Checkout Payment Details', 'accept-2checkout-payments-using-contact-form-7' ), 'edit_item' => __( 'Transaction Detail', 'accept-2checkout-payments-using-contact-form-7' ), ); $args = array( 'label' => __( '2Checkout Payment Details', 'accept-2checkout-payments-using-contact-form-7' ), 'labels' => $labels, 'description' => '', 'public' => false, 'publicly_queryable' => false, 'show_ui' => true, 'delete_with_user' => false, 'show_in_rest' => false, 'rest_base' => '', 'has_archive' => false, 'show_in_menu' => 'wpcf7', 'show_in_nav_menus' => false, 'exclude_from_search' => true, 'capability_type' => 'post', 'capabilities' => array( 'read' => true, 'create_posts' => false, 'publish_posts' => false, ), 'map_meta_cap' => true, 'hierarchical' => false, 'rewrite' => false, 'query_var' => false, 'supports' => array( 'title' ), ); register_post_type( 'cf72ch_data', $args ); } /** * Gnerare Tag Callback function load option which want to display * * @method action__cf72ch_admin_init * * @return html */ function action__cf72ch_admin_init() { $tag_generator = WPCF7_TagGenerator::get_instance(); $tag_generator->add( 'two_checkout', __( '2Checkout', 'accept-2checkout-payments-using-contact-form-7' ), array( $this, 'wpcf7_tag_generator_checkout' ) ); $tag_generator = WPCF7_TagGenerator::get_instance(); $tag_generator->add( 'two_checkout_country', __( '2Checkout Country', 'accept-2checkout-payments-using-contact-form-7' ), array( $this, 'wpcf7_two_checkout_country_tag_generator_checkout' ) ); } /* ######## #### ## ######## ######## ######## ###### ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ###### ## ## ## ###### ######## ###### ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #### ######## ## ######## ## ## ###### */ /* ######## ## ## ## ## ###### ######## #### ####### ## ## ###### ## ## ## ### ## ## ## ## ## ## ## ### ## ## ## ## ## ## #### ## ## ## ## ## ## #### ## ## ###### ## ## ## ## ## ## ## ## ## ## ## ## ## ###### ## ## ## ## #### ## ## ## ## ## ## #### ## ## ## ## ## ### ## ## ## ## ## ## ## ### ## ## ## ####### ## ## ###### ## #### ####### ## ## ###### */ /** * Render CF7 Shortcode settings into backend. * * @method wpcf7_tag_generator_2checkout * * @param object $contact_form * @param array $args */ function wpcf7_tag_generator_checkout( $contact_form, $args = '' ) { $args = wp_parse_args( $args, array() ); $type = $args['id']; $description = __( "Generate a form-tag for to display 2Checkout payment form", 'accept-2checkout-payments-using-contact-form-7' ); ?>