get( 'locations' ); if ( $locations ) { foreach ( array( 'header', 'footer' ) as $location ) { $id = $locations->get_template( $location ); if ( $id ) { $used[] = $id; } } } $loader = Plugin::instance()->get( 'loader' ); if ( $loader && $loader->get_content_template() ) { $used[] = $loader->get_content_template(); } $conditions = Plugin::instance()->get( 'conditions' ); if ( $conditions && Settings::is_on( 'popups' ) && ! is_singular( Post_Type::POST_TYPE ) ) { $used = array_merge( $used, array_keys( $conditions->get_matching_templates( 'popup' ) ) ); } $bar->add_node( array( 'id' => 'buildify', 'title' => __( 'Buildify', 'buildify' ), 'href' => admin_url( 'admin.php?page=buildify' ), ) ); foreach ( array_unique( $used ) as $id ) { $document = \Elementor\Plugin::$instance->documents->get( $id ); $bar->add_node( array( 'parent' => 'buildify', 'id' => 'buildify-template-' . $id, /* translators: 1: template type, 2: template title. */ 'title' => esc_html( sprintf( __( '%1$s: %2$s', 'buildify' ), Template_Types::label( Template_Types::of( $id ) ), get_the_title( $id ) ) ), 'href' => $document ? $document->get_edit_url() : get_edit_post_link( $id, 'raw' ), ) ); } $bar->add_node( array( 'parent' => 'buildify', 'id' => 'buildify-all', 'title' => __( 'All templates', 'buildify' ), 'href' => admin_url( 'edit.php?post_type=' . Post_Type::POST_TYPE ), ) ); } }