PluginProbe
Phone Button / 1.0.1
Phone Button v1.0.1
trunk 1.0.0 1.0.1 1.0.3 1.1.0 1.1.1 2.0.0 2.1.0 2.1.1 2.1.2
phone-button / index.php

index.php in Phone Button 1.0.1, at index.php

85 lines 2.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
2 <?php
3 /*
4 Plugin Name: YYDevelopment - Phone Button
5 Plugin URI: https://www.yydevelopment.com/
6 Description: Simple plugin that allow you add phone button to your site
7 Version: 1.0.1
8 Author: YYDevelopment
9 Author URI: https://www.yydevelopment.co.il/
10 */
11
12 include_once('include/settings.php');
13 require_once('include/functions.php');
14
15 // ================================================
16 // Creating Database when the plugin is activated
17 // ================================================
18
19
20 function yydev_phone_btn_create_database() {
21
22 require_once('include/install.php');
23
24 } // function yydev_phone_btn_create_database() {
25
26 register_activation_hook(__FILE__, 'yydev_phone_btn_create_database');
27
28 // ================================================
29 // display the plugin we have create on the wordpress
30 // post blog and pages
31 // ================================================
32
33 // function that will output the code to the page
34 function output_yydev_phone_btn() {
35
36 include('include/style.php');
37 include('include/scripts.php');
38 include('include/admin-output.php');
39
40 } // function output_yydev_phone_btn() {
41
42 // -----------------------------------------------
43 // load the page into settings page
44 // -----------------------------------------------
45
46 // in case of settings menu loading
47 function register_yydev_phone_btn_page() {
48 add_options_page( 'Phone Button', "Phone Button", 'manage_options', 'yydev-phone-btn', 'output_yydev_phone_btn');
49 } // function register_yydev_phone_btn_page() {
50
51 add_action('admin_menu', 'register_yydev_phone_btn_page');
52
53 // ================================================
54 // Add settings page to the plugin menu info
55 // ================================================
56
57 function yydev_phone_btn_add_settings_link( $actions, $plugin_file ) {
58 static $plugin;
59
60 if (!isset($plugin)) { $plugin = plugin_basename(__FILE__); }
61 if ($plugin == $plugin_file) {
62 $admin_page_url = esc_url( menu_page_url( 'yydev-phone-btn', false ) );
63 $settings = array('settings' => '<a href="' . $admin_page_url . '">Settings</a>');
64 $actions = array_merge($settings, $actions);
65 } // if ($plugin == $plugin_file) {
66 return $actions;
67 } //function yydev_phone_btn_add_settings_link( $actions, $plugin_file ) {
68
69 add_filter( 'plugin_action_links', 'yydev_phone_btn_add_settings_link', 10, 5 );
70
71 // ================================================
72 // output the data into the page front end
73 // ================================================
74
75 if( !is_admin() ) {
76 include('include/front-end-output.php');
77 } // if( !is_admin() ) {
78
79 // ================================================
80 // including admin notices flie
81 // ================================================
82
83 if( is_admin() ) {
84 include_once('notices.php');
85 } // if( is_admin() ) {