Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wordpress-snippets
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Simone
wordpress-snippets
Commits
77117c66
Commit
77117c66
authored
Jan 29, 2019
by
Simone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete class-option-page.php
parent
0e3f63e8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
80 deletions
+0
-80
class-option-page.php
class-option-page.php
+0
-80
No files found.
class-option-page.php
deleted
100644 → 0
View file @
0e3f63e8
<?php
class
Options_Page
{
const
options_group_name
=
'lm-option-group'
;
private
$options
;
public
function
__construct
(){
add_action
(
'admin_menu'
,
array
(
$this
,
'add_menu'
)
);
add_action
(
'admin_init'
,
array
(
$this
,
'register_settings'
)
);
$this
->
options
=
array
(
array
(
'name'
=>
'lm_facebook_url'
,
'label'
=>
'Facebook URL'
),
array
(
'name'
=>
'lm_linkedin_url'
,
'label'
=>
'LinkedIn URL'
)
);
}
public
function
add_menu
()
{
add_options_page
(
'Leonardo Mannelli Config'
,
'Leonardo Mannelli Config'
,
'manage_options'
,
'leoman-config.php'
,
array
(
$this
,
'lm_option_page'
)
);
}
public
function
register_settings
(){
foreach
(
$this
->
options
as
$option
){
register_setting
(
self
::
options_group_name
,
$option
[
'name'
]
);
}
}
public
function
lm_option_page
(){
?>
<div
class=
"wrap"
>
<h1>
Opzioni Tema Leonardo Mannelli
</h1>
<form
method=
"post"
action=
"options.php"
>
<?php
settings_fields
(
'lm-option-group'
);
do_settings_sections
(
'lm-option-group'
);
?>
<table
class=
"form-table"
>
<?php
foreach
(
$this
->
options
as
$option
)
:
?>
<tr
valign=
"top"
>
<th
scope=
"row"
>
<?php
echo
$option
[
'label'
]
?>
</th>
<td><input
type=
"text"
size=
"100"
name=
"
<?php
echo
$option
[
'name'
]
?>
"
value=
"
<?php
echo
esc_attr
(
get_option
(
$option
[
'name'
])
);
?>
"
/></td>
</tr>
<?php
endforeach
?>
</table>
<?php
submit_button
();
?>
</form>
</div>
<?php
}
}
new
Options_Page
();
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment