Commit ad6ff54d authored by Isaque Melo's avatar Isaque Melo

Adiciona pagina de integração para inserção de dados da API

parent 1a230453
......@@ -9,6 +9,7 @@ License: GPL2
*/
require 'library/functions.php';
require 'library/panel-options.php';
require 'library/images.php';
require 'library/related-posts.php';
require 'library/authors.php';
......
<?php
function add_my_theme_page() {
add_theme_page("Dados de Integração", "Dados de Integração", "manage_options", "integration-options", "theme_option_page", null, 99);
}
add_action( 'admin_menu', 'add_my_theme_page' );
function theme_option_page() {
?>
<div class="wrap">
<h1>Dados de Integração</h1>
<form method="post" action="options.php">
<?php
settings_fields("integration-options-grp");
do_settings_sections("integration-options");
submit_button();
?>
</form>
</div>
<?php
}
function theme_section_description(){
//echo '<p>Theme Option Section</p>';
}
function display_fb_app_id(){
$fb_app_id = get_option( 'fb_app_id' );
echo '<input name="fb_app_id" id="fb_app_id" type="text" value="'. $fb_app_id .'" class="code" /> ';
}
function display_fb_app_secret() {
$fb_app_secret = get_option( 'fb_app_secret' );
echo '<input name="fb_app_secret" id="fb_app_secret" type="text" value="'. $fb_app_secret .'" class="code" /> ';
}
function test_theme_settings(){
//add_option('fb_app_id', 0);
add_settings_section( 'first_section', 'Facebook', 'theme_section_description','integration-options');
add_settings_field( 'fb_app_id','App ID','display_fb_app_id','integration-options','first_section');
register_setting( 'integration-options-grp', 'fb_app_id');
add_settings_field( 'fb_app_secret','App Secret','display_fb_app_secret','integration-options','first_section');
register_setting( 'integration-options-grp', 'fb_app_secret');
}
add_action('admin_init','test_theme_settings');
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment