# phone-button/trunk/index.php

Phone Button, version trunk. 108 lines.

- Page: https://pluginprobe.com/plugins/phone-button/trunk/code/index.php
- Raw: https://pluginprobe.com/plugins/phone-button/trunk/raw/index.php
- Modified: 2025-08-26T07:56:46+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/phone-button/trunk/code/index.php#L10-L20`.

```php
<?php if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
<?php
/*
Plugin Name: YYDevelopment - Phone Button
Plugin URI:  https://www.yydevelopment.com/yydevelopment-wordpress-plugins/
Description: Simple plugin that allow you add phone button to your site
Version:     2.1.2
Author:      YYDevelopment
Author URI:  https://www.yydevelopment.com/
*/

include_once('include/settings.php');
require_once('include/functions.php');

// ================================================
// Creating Database when the plugin is activated
// ================================================


function yydev_phone_btn_create_database() {
    
    require_once('include/install.php');
        
} // function yydev_phone_btn_create_database() {

register_activation_hook(__FILE__, 'yydev_phone_btn_create_database');

// ================================================
// display the plugin we have create on the wordpress
// post blog and pages
// ================================================

// function that will output the code to the page
function output_yydev_phone_btn() {

    include('include/style.php');
    include('include/scripts.php');
    include('include/admin-output.php');

} // function output_yydev_phone_btn() {

// -----------------------------------------------
// load the page into settings page
// -----------------------------------------------

// in case of settings menu loading
function register_yydev_phone_btn_page() {
    add_options_page( 'Phone Button', "Phone Button", 'manage_options', 'yydev-phone-btn', 'output_yydev_phone_btn');
} // function register_yydev_phone_btn_page() {

add_action('admin_menu', 'register_yydev_phone_btn_page');

// ================================================
// Add settings page to the plugin menu info
// ================================================

function yydev_phone_btn_add_settings_link( $actions, $plugin_file ) {
	static $plugin;

    if (!isset($plugin)) { $plugin = plugin_basename(__FILE__); }
	if ($plugin == $plugin_file) {
            $admin_page_url = esc_url( menu_page_url( 'yydev-phone-btn', false ) );
			$settings = array('settings' => '<a href="' . $admin_page_url . '">Settings</a>');
            $actions = array_merge($settings, $actions);
    } // if ($plugin == $plugin_file) {
    return $actions;
} //function yydev_phone_btn_add_settings_link( $actions, $plugin_file ) {

add_filter( 'plugin_action_links', 'yydev_phone_btn_add_settings_link', 10, 5 );

// ================================================
// Add donate page to the plugin menu info
// ================================================

add_filter( 'plugin_action_links', function($actions, $plugin_file) {

	static $plugin;

    if (!isset($plugin)) { $plugin = plugin_basename(__FILE__); }
    
	if ($plugin == $plugin_file) {

            $admin_page_url = esc_url( menu_page_url( 'phone-button', false ) );
            $donate = array('donate' => '<a target="_blank" href="https://www.yydevelopment.com/coffee-break/?plugin=phone-button">Donate</a>');
		
            $actions = array_merge($donate, $actions);
        
    } // if ($plugin == $plugin_file) {
		
    return $actions;

}, 10, 5 );

// ================================================
// output the data into the page front end
// ================================================

if( !is_admin() ) {
    include('include/front-end-output.php');
} // if( !is_admin() ) {

// ================================================
// including admin notices flie
// ================================================

if( is_admin() ) {
	include_once('notices.php');
} // if( is_admin() ) {
```
