how change my menu on submenu

You can add a sub menu like below. // Call Terms_and_conditions_menu is function which load plugin menu add_action( ‘admin_menu’, ‘Terms_and_conditions_menu’ ); // Add to WordPress admin menu if( !function_exists(“Terms_and_conditions_menu”) ) { function Terms_and_conditions_menu(){ $page_title=”WordPress Extra Post Info”; $menu_title=”Terms And Conditions”; $capability = ‘manage_options’; $menu_slug = ‘terms-post-info’; $function = ‘terms_post_info_page’; $icon_url=”dashicons-media-code”; $position = 4; add_menu_page( $page_title, … Read more

Passing ajax variable to more than one wordpress plugin function

If you want to use a global variable, you have to set it outside any local scope, above your functions. For example: if (isset($_POST[‘whatever’])) { $variable = $_POST[‘whatever’]; } This will store it in the superglobal array. Now, access it using the $_GLOBALS array: function my_action(){ $whatever = $GLOBALS[‘variable’]; } I would however have an … Read more

Get not the full path

You might want to use the media_media_sideload_image() function. This function will fetch an image from a URL and upload it for you. Take a look into this custom function: function upload_image_from_url($image_url, $post_id, $title) { $img_name = basename ($image_url); global $wpdb; $query = “SELECT post_id FROM {$wpdb->postmeta} WHERE meta_value=”$img_name””; $id = $wpdb->get_var($query); if (is_numeric($id)) { return … Read more

plugin_dir_url(__FILE__) searches parent theme in ACF extension

I’m a total dummy. Looked through the field file and found this: function input_admin_enqueue_scripts() { // Note: This function can be removed if not used // register acf scripts wp_register_script(‘acf-input-column’, $this->settings[‘dir’] . ‘js/input.js’, array(‘acf-input’), $this->settings[‘version’]); wp_register_style(‘acf-input-column’, $this->settings[‘dir’] . ‘css/input.css’, array(‘acf-input’), $this->settings[‘version’]); // scripts wp_enqueue_script(array( ‘acf-input-column’, )); // styles wp_enqueue_style(array( ‘acf-input-column’, )); } $settings->[‘dir’] was set … Read more

AddThis Plugin adding html comments in P tags

You put this function there: $(“#main”).each(function() { var text = $(this).text(); text = text.replace(“<p><!– AddThis Sharing Buttons above –></p>”, “”); $(this).text(text); }); Did it work? If not, why do you want to do that? You can go to the main plugin and replace this text..