fsylum / outdated-notice Goto Github PK
View Code? Open in Web Editor NEW[SitePoint] Sample plugin using the WordPress plugin boilerplate
[SitePoint] Sample plugin using the WordPress plugin boilerplate
`<?php
/**
/**
The admin-specific functionality of the plugin.
Defines the plugin name, version, and two examples hooks for how to
enqueue the admin-specific stylesheet and JavaScript.
@Package Sharefile_Connector
@subpackage Sharefile_Connector/admin
@author Azmat Mehmood [email protected]
*/
class Sharefile_Connector_Admin
{
/**
/**
/**
/**
Initialize the class and set its properties.
@SInCE 1.0.0
@param string $plugin_name The name of this plugin.
@param string $version The version of this plugin.
*/
public function __construct($plugin_name, $version)
{
$this->plugin_name = $plugin_name;
$this->version = $version;
}
/**
Register the stylesheets for the admin area.
@SInCE 1.0.0
*/
public function enqueue_styles()
{
/**
wp_enqueue_style($this->plugin_name, plugin_dir_url(FILE) . 'css/sharefile-connector-admin.css', array(), $this->version, 'all');
}
/**
Register the JavaScript for the admin area.
@SInCE 1.0.0
*/
public function enqueue_scripts()
{
/**
wp_enqueue_script($this->plugin_name, plugin_dir_url(FILE) . 'js/sharefile-connector-admin.js', array('jquery'), $this->version, false);
}
public function config_page()
{
$this->plugin_screen_hook_suffix = add_options_page(
__( 'SF Connector Config', 'sharefile-config' ),
__( 'SF Connector Config', 'sharefile-config' ),
'manage_options',
$this->plugin_name,
array($this, 'display_config_page_callback')
);
}
public function display_config_page_callback()
{
include_once 'partials/sharefile-connector-admin-display.php';
}
public function register_setting()
{
// Add General Section
add_settings_section(
$this->option_name.'general',
__( 'API Credentials', 'sharefile-config' ),
array($this, $this->option_name.'general_section_callback'),
$this->plugin_name
);
add_settings_field(
$this->option_name.'hostname',
__( 'Host Name', 'sharefile-config' ),
array($this, $this->option_name.'hostname_callback'),
$this->plugin_name,
$this->option_name.'general',
array('label_for' => $this->option_name.'hostname')
);
add_settings_field(
$this->option_name.'username',
__( 'ShareFile Username', 'sharefile-config' ),
array($this, $this->option_name.'username_callback'),
$this->plugin_name,
$this->option_name.'general',
array('label_for' => $this->option_name.'username')
);
add_settings_field(
$this->option_name.'password',
__( 'ShareFile Password', 'sharefile-config' ),
array($this, $this->option_name.'password_callback'),
$this->plugin_name,
$this->option_name.'general',
array('label_for' => $this->option_name.'password')
);
add_settings_field(
$this->option_name.'client_id',
__( 'ShareFile Client_id', 'sharefile-config' ),
array($this, $this->option_name.'client_id_callback'),
$this->plugin_name,
$this->option_name.'general',
array('label_for' => $this->option_name.'client_id')
);
add_settings_field(
$this->option_name.'client_secret',
__( 'ShareFile Client_secret', 'sharefile-config' ),
array($this, $this->option_name.'client_secret_callback'),
$this->plugin_name,
$this->option_name.'general',
array('label_for' => $this->option_name.'client_secret')
);
register_setting( $this->plugin_name, $this->option_name.'hostname' );
register_setting( $this->plugin_name, $this->option_name.'username' );
register_setting( $this->plugin_name, $this->option_name.'password' );
register_setting( $this->plugin_name, $this->option_name.'client_id' );
register_setting( $this->plugin_name, $this->option_name.'client_secret' );
}
public function sfc_general_section_callback()
{
echo '
'.__( 'Please put your API credentials from ShareFile here.', 'sharefile-config' ).'
' ;public function sfc_hostname_callback()
{
?>
<?php
}
public function sfc_username_callback()
{
?>
<?php
}
public function sfc_password_callback()
{
?>
<?php
}
public function sfc_client_id_callback()
{
?>
<?php
}
public function sfc_client_secret_callback()
{
?>
<?php
}
}
`
everything is same but no field on page.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.