post = $post; } /** * Generate array of controls by iterating property $controls list. * vc_filter: vc_nav_controls - hook to override list of controls * @return array - list of arrays witch contains key name and html output for button. */ public function getControls() { $list = array(); foreach ( $this->controls as $control ) { $method = vc_camel_case( 'get_control_' . $control ); if ( method_exists( $this, $method ) ) { $list[] = array( $control, $this->$method() . "\n" ); } } return apply_filters( $this->controls_filter_name, $list ); } /** * Get current post. * @return null|WP_Post */ public function post() { if ( $this->post ) { return $this->post; } return get_post(); } /** * Render template. */ public function render() { vc_include_template( 'editors/navbar/navbar.tpl.php', array( 'css_class' => $this->css_class, 'controls' => $this->getControls(), 'nav_bar' => $this, 'post' => $this->post(), ) ); } /** * vc_filter: vc_nav_front_logo - hook to override visual composer logo * @return mixed|void */ public function getLogo() { $output = '' . __( 'Visual Composer', 'js_composer' ) . ''; return apply_filters( 'vc_nav_front_logo', $output ); } /** * @return string */ public function getControlCustomCss() { if ( ! vc_user_access()->part( 'post_settings' )->can()->get() ) { return ''; } return '