[
'title' => __( 'Blog', 'elementor' ),
'link' => 'https://go.elementor.com/overview-widget-blog/',
],
'help' => [
'title' => __( 'Help', 'elementor' ),
'link' => 'https://go.elementor.com/overview-widget-docs/',
],
];
$additions_actions = [
'go-pro' => [
'title' => __( 'Go Pro', 'elementor' ),
'link' => Utils::get_pro_link( 'https://elementor.com/pro/?utm_source=wp-overview-widget&utm_campaign=gopro&utm_medium=wp-dash' ),
],
];
/**
* Dashboard widget footer actions.
*
* Filters the additions actions displayed in Elementor dashboard widget.
*
* Developers can add new action links to Elementor dashboard widget
* footer using this filter.
*
* @since 1.9.0
*
* @param array $additions_actions Elementor dashboard widget footer actions.
*/
$additions_actions = apply_filters( 'elementor/admin/dashboard_overview_widget/footer_actions', $additions_actions );
$actions = $base_actions + $additions_actions;
return $actions;
}
/**
* Admin action new post.
*
* When a new post action is fired the title is set to 'Elementor' and the post ID.
*
* Fired by `admin_action_elementor_new_post` action.
*
* @since 1.9.0
* @access public
*/
public function admin_action_new_post() {
check_admin_referer( 'elementor_action_new_post' );
if ( empty( $_GET['post_type'] ) ) {
$post_type = 'post';
} else {
$post_type = $_GET['post_type'];
}
if ( ! User::is_current_user_can_edit_post_type( $post_type ) ) {
return;
}
if ( empty( $_GET['template_type'] ) ) {
$type = 'post';
} else {
$type = sanitize_text_field( $_GET['template_type'] );
}
$post_data = isset( $_GET['post_data'] ) ? $_GET['post_data'] : [];
$meta = [];
/**
* Create new post meta data.
*
* Filters the meta data of any new post created.
*
* @since 2.0.0
*
* @param array $meta Post meta data.
*/
$meta = apply_filters( 'elementor/admin/create_new_post/meta', $meta );
$post_data['post_type'] = $post_type;
$document = Plugin::$instance->documents->create( $type, $post_data, $meta );
if ( is_wp_error( $document ) ) {
wp_die( $document );
}
wp_redirect( $document->get_edit_url() );
die;
}
/**
* @since 2.3.0
* @access public
*/
public function add_new_template_template() {
Plugin::$instance->common->add_template( ELEMENTOR_PATH . 'includes/admin-templates/new-template.php' );
}
/**
* @access public
*/
public function enqueue_new_template_scripts() {
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
wp_enqueue_script(
'elementor-new-template',
ELEMENTOR_ASSETS_URL . 'js/new-template' . $suffix . '.js',
[],
ELEMENTOR_VERSION,
true
);
}
/**
* @since 2.6.0
* @access public
*/
public function add_beta_tester_template() {
Plugin::$instance->common->add_template( ELEMENTOR_PATH . 'includes/admin-templates/beta-tester.php' );
}
/**
* @access public
*/
public function enqueue_beta_tester_scripts() {
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
wp_enqueue_script(
'elementor-beta-tester',
ELEMENTOR_ASSETS_URL . 'js/beta-tester' . $suffix . '.js',
[],
ELEMENTOR_VERSION,
true
);
}
/**
* @access public
*/
public function init_new_template() {
if ( 'edit-elementor_library' !== get_current_screen()->id ) {
return;
}
// Allow plugins to add their templates on admin_head.
add_action( 'admin_head', [ $this, 'add_new_template_template' ] );
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_new_template_scripts' ] );
}
public function version_update_warning( $current_version, $new_version ) {
$current_version_minor_part = explode( '.', $current_version )[1];
$new_version_minor_part = explode( '.', $new_version )[1];
if ( $current_version_minor_part === $new_version_minor_part ) {
return;
}
?>
backup your site before upgrading, and make sure you first update in a staging environment', 'elementor' ), 'https://go.elementor.com/wp-dash-update-backup' ); ?>