admin_url('admin-ajax.php'),
'nonce' => wp_create_nonce('twae_upgrade_notice_nonce'),
]
);
}
/**
* Enqueue frontend styles.
*
* @since 1.0.0
*
* @return void
*/
function twe_enqueue_style() {
wp_enqueue_style( 'twe-preview', TWE_PLUGIN_URL . 'assets/css/style.css', array(), TWE_VERSION);
}
class TweTimelinePlugin {
private static $instance = null;
public static function get_instance() {
if ( ! self::$instance )
self::$instance = new self;
return self::$instance;
}
public function init(){
add_action( 'elementor/widgets/widgets_registered', array( $this, 'widgets_registered' ) );
}
public function widgets_registered() {
if ( defined('ELEMENTOR_PATH') && class_exists('Elementor\Widget_Base') ) {
$template_file = plugin_dir_path(__FILE__) . 'timeline-widget.php';
if ( is_readable($template_file) ) {
require_once $template_file;
}
}
}
}
TweTimelinePlugin::get_instance()->init();
add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), 'twe_add_pro_link' );
/**
* function add pro link.
*
* @return links
*/
function twe_add_pro_link( $links ) {
$links[] = 'Get Pro';
return $links;
}
add_filter( 'plugin_row_meta', 'twe_add_view_demo_row_meta', 10, 2 );
/**
* function add view demo link.
*
* @return links
*/
function twe_add_view_demo_row_meta( $links, $file ) {
if ( $file === plugin_basename( __FILE__ ) ) {
$demo_link = '