How can I call functions from a custom plugin?

You don’t, alert is a javascript function that runs in the browser. PHP runs on the server, the two are different languages that run in different places. Instead, consider using script tags: return ‘<script>window.alert(“Connected to the database successfully.”)</script>’;` console.log(“”) may be a more appropriate method than alert(“”) for debugging I would also note, that shortcodes … Read more

Add function to Dokan ajax class

This is the core developer of Dokan. There is a much simpler way to use your custom function for this case. This dokan_add_shipping_tracking_info action can be found within this template : /rafsuntaskin.com/wp-content/plugins/dokan/templates/orders/details.php . You can copy this into your theme and change the action to your custom function like this : rt_custom_add_shipping_tracking_info replaces dokan_add_shipping_tracking_info Then … Read more

Media Upload to custom database and Custom Directory

I suppose, you didn’t create table imageupload or can’t create folder if_images at your plugin folder. As a proposal I suggest you to use built-in WordPress functions and wordpress tables or create table on plugin activation. To create new table use function dbDelta. If you want to upload user files, use well-documented wp_handle_upload function. For … Read more

I have a plugin where in I have to change the title of the page dynamically by sending parameter to the_title filter

You can use the is_page() function to only change it on a certain page. I’m assuming the slug of your company page is in fact company add_filter( ‘the_title’,’wpse_277956_the_title’, 10, 2 ); function wpse_277956_the_title( $title, $id ){ if( in_the_loop() && is_page( ‘company’ ) ) { return bmg_company_detail_shortcode( false, false ); } return $title; }