pageSupportedMediaButtons()) { return; } $this->addMceButtonAssets(); $label = __('Add Form', 'fluentform'); $url = App::publicUrl('img/icon_black_small.png'); echo ""; } private function addMceButtonAssets() { wp_enqueue_script( 'fluentform_editor_script', fluentformMix('js/fluentform_editor_script.js'), array('jquery'), FLUENTFORM_VERSION ); $forms = wpFluent()->table('fluentform_forms') ->select(array('id', 'title')) ->get(); $forms = array_map(function($item) { return array('value' => $item->id, 'text'=> $item->title); }, $forms); wp_localize_script('fluentform_editor_script', 'fluentform_editor_vars', array( 'forms' => $forms )); } private function pageSupportedMediaButtons() { $currentPage = basename( $_SERVER['PHP_SELF'] ); $isEligiblePage = in_array( $currentPage, array( 'post.php', 'page.php', 'page-new.php', 'post-new.php', 'customize.php', )); if ($isEligiblePage) { $option = get_option('_fluentform_global_form_settings'); $isEligiblePage = ArrayHelper::get($option, 'misc.classicEditorButton') == 'yes'; } return apply_filters( 'fluentform_display_add_form_button', $isEligiblePage ); } private function getMenuIcon() { return 'data:image/svg+xml;base64,'.base64_encode('dashboard_icon'); } }