I editing custom page in wp-admin. Currently in editor i see that
[vc_column_text]Titile1[/vc_column_text]
After each [/vc_column_text]
i need to display some info from database. How i can call php function with some parameters in wp-admin editor ?
Like this or so:
[vc_column_text]Titile[/vc_column_text]
[getInforFromDatabase('Titile1')]
This will take quite some doing. You just may not directly call a PHP function from within the WP-Admin Editor but you can create a simple, rudimentary Plugin to do the heavy-lifting for you. And then expose a short-code that you can use from within the WP Admin Editor.
To do this, first create a a Directory in your wp-content/plugins directory. For the purposes of demonstration, we will call this directory: dbInfoSifter but the name is completely up to you. In the end, the path to this directory would be: wp-content/plugins/dbInfoSifter
Now inside of this Folder (dbInfoSifter), create a PHP File with the same name again so that you have: wp-content/plugins/dbInfoSifter/dbInfoSifter.php. Now add the following Code inside the dbInfoSifter.php File:
That’s all… nothing really special to it… But you can also have other Functions within this File that does something, anyways. However, the most important parts of this File (in your case) are: 1.) The function: dbsGetInfoFromDatabase($args) and 2.) The Comments at the Top of the File.
Now, inside the WP-Admin Editor; you can just simply reference this function using the short-code we created like so:
Alternatively, You can do it like so:
Both will achieve the same Result, but the First one seems more concise (to me). Take your pick.
Finally, you need to activate the Plugin at the Backend for this to work. So; navigate to your Plugins Section (at the Backend of WordPress). You will notice a new Plugin called DB Info Sifter. Simply activate it and you are finally ALL DONE. Your short-code would now work as if you actually called a function and passed it the $title1 parameter.
I hope this helps you a little bit and gives you a head-start…
Good-Luck to you, my Friend…