ini plugin

This commit is contained in:
asus
2024-02-12 11:26:44 +01:00
parent ff7a9423a1
commit 3f38cf523a
8 changed files with 38 additions and 36 deletions

View File

@@ -41,7 +41,7 @@ plugin shortcode
*/
function fipfcard_main_shortcode() {
add_files_to_front( array(
fipfcard_add_files_to_front( array(
"example_style.css",
"example_init.js",
"example_script2.js",
@@ -51,7 +51,7 @@ function fipfcard_main_shortcode() {
$myvar_1 = "I am one";
$myvar_2 = "I am two";
add_var_to_front( compact(
fipfcard_add_var_to_front( compact(
"myvar_1",
"myvar_2",
));
@@ -59,7 +59,7 @@ function fipfcard_main_shortcode() {
$names = ["hugo", "camille"];
$ages = ["13", "34", "56"];
$html_front = create_html(
$html_front = fipfcard_create_html(
array(
"example_index.html",
"example_index2.html",
@@ -83,11 +83,11 @@ menu plugin
*/
function fipfcard_plugin_menu() {
add_menu_page(
'wp model plugin', // webpage title
'model plugin', // menu title
'fipf_card', // webpage title
'fipf_card', // menu title
'manage_options', // capability
'wp-model-plugin', // menu_slug
'wp_model_plugin_content' // callback function to display page content
'fipfcard-plugin', // menu_slug
'fipfcard_plugin_content' // callback function to display page content
);
}
add_action('admin_menu', 'fipfcard_plugin_menu');
@@ -105,7 +105,7 @@ ajax
- to access the content of the data object properties of the ajax call :
use $_POST['property_name']
*/
function my_ajax_handler() {
function fipfcard_ajax_handler() {
wp_send_json_success( array(
'It works',
"data_received" => $_POST['data'],
@@ -113,7 +113,7 @@ function my_ajax_handler() {
200
);
}
add_action( 'wp_ajax_get_data', 'my_ajax_handler' );
add_action( 'wp_ajax_get_data', 'fipfcard_ajax_handler' );
?>