Articles of settings api

Theme settings Page: Settings Api vs Update_Options

I’m a new WordPress developer trying to start a carrier selling Premium Themes. In the last week, I’ve been confronted to many difficulties trying to understand how to create a theme options page. At the end I’ve finally understood the way I should do it using the settings api. Then, I tried to customize the […]

Setting conditional background image from meta value

I am trying to set background image from meta value.I am successful also.But if the meta image is not set the out put <div id=”pricing” style=”background: url(”)”></div> But I do not want to show background: url(”) if there is not meta value is set.My code to get image $bgimage= get_post_meta( $post->ID, ‘settings_image’, true ); $img=background-image: […]

Plugin settings are saving but the fields

I’m following @Otto’s tutorial on Settings API. I managed to save the plugin settings into the options table, but by any means can’t save any fields. <?php /** * Add Settings SubMenu * Thanks to: Otto * Following: */ function plugins_settings_page() { add_submenu_page( ‘my-page-slug’, //$parent_slug ‘Plugin Settings’, //$page_title ‘Plugin Settings’, //$menu_title ‘manage_options’, //$capability ‘plugin-settings’, […]

Uploading files using the Settings API

I’ve used the Settings API in the past to output text inputs and checkboxes but am unsure if I can use file inputs. My add_settings_field() is: add_settings_field( ‘1’, ‘File 1’, array( $this, ‘my_callback’ ), ‘files’, ‘files’ ); My callback function: public function my_callback() { echo ‘<input type=”file” name=”file” />’; } I assume the next step […]

'delete_option()' only deleting the value, not the key/value pair

Recently a plugin I am developing begun throwing up an error whenever I deleted the plugin options (restored them to default). I’m using the Settings API within the plugin in question, and on another page I am checking the settings assigned to those options – $login_settings = get_option(‘fgw_login’, array()); Upon activation and after I save […]

Customizing Latest Post Pagination

I was able to successfully implement pagination for my “Latest Posts” page. But I want to separate the numbers after the current page and put a separator between them and the last page. Here is my html that I want to implement: <div class=”pagination-tt clearfix”> <ul> <li><span class=”deactive”>1</span></li> <li><a href=”#” class=”tbutton”><span>2</span></a></li> <li><a href=”#” class=”tbutton”><span>3</span></a></li> <li><span […]

500 error when updating plugin option

I’m trying to debug a strange issue that happens on one my plugin’s users system. The issue: When i submit my Plugin’s Settings form (option-general.php?page=pluginname), I get a 500 error message. Other setting pages work fine, just this one. I couldn’t reproduce the error when simply using my plugin on a fresh wordpress copy. I […]

Settings field is not showing up in the general options page

I’ve tried to add a pretty basic test case based on a tutorial by creating a custom settings field in the general options page in the admin area. Problem is the settings field is not showing up, nor any error, just nothing. So no idea how to track down the cause of the no show. […]

Save and user submitted data from a form and display them in the wp backend

My question is very simple but the answer I’m not sure if will be that simple. I’m developing a website for a non-profit organization where people can fill out a form containing questions usually asked by a doctor. Once a user submits the form I would like to grab the answers and display them in […]

Settings API Message Error is global

Am not shure how to realy use settings api for showing error messages on my menu-page. For example i create menu page (eng.product)and there i register two input text fields like example. After submiting my form in my custom page error message is the some in all options page “reading, writing, premalinks, …etc”. Whay is […]