Elementor Code Reference
  • Developers
  • Code Reference
  • Docs
  • Blog
  • Account
  • Developers
  • Code Reference
  • Docs
  • Blog
  • Account

Admin::add_elementor_post_state

Admin::add_elementor_post_state( array $post_states, WP_Post $post )

Add Elementor post state.


Description

Adds a new "Elementor" post state to the post table.

Fired by display_post_states filter.


Parameters

Parameters
Name Type Required Description
$post_states array Required An array of post display states.
$post WP_Post Required The current post object.

Return

(array) A filtered array of post display states.


Changelog

Changelog
Version Description
1.8.0 Introduced.

Source

includes/admin.php

	public function add_elementor_post_state( $post_states, $post ) {
		if ( User::is_current_user_can_edit( $post->ID ) && Plugin::$instance->db->is_built_with_elementor( $post->ID ) ) {
			$post_states['elementor'] = __( 'Elementor', 'elementor' );
		}
		return $post_states;
	}
Elementor Code Reference
  • Code Reference
  • Elementor Hooks
    • PHP Hooks
    • JS Hooks
  • Elementor Classes
  • Elementor Methods
  • Elementor Functions
Developer Resources

Visit the official Developer Resources to learn how to extend Elementor.

Get Involved

Visit Elementor GitHub repository to contribute code or suggest new ideas.

  • Contact
  • About Us
  • Terms of Service
  • Privacy Policy
  • Template Library
  • Features
  • Theme Builder
  • Get Pro
Theme by Pojo.me
//Made in Elementor Page Builder
Enter your email and be the first to learn about new updates and features.
No thanks, I just want to download Elementor