Can you have more than one nonce on a page?

I have a site with a page where there’s one form in the sidebar, and one in the main body of the page. The sidebar comes first in the HTML. Both forms have their own nonces (generated with wp_nonce_field) with different $action and $name parameters. The $referrer fields are on. When I submit the second form, I get the usual « Are you sure you want to do this? » message. If I remove the first form, things work correctly. I added some debugging to wp_verify_nonce (var_dump statements and an exit;) and…

List children of second level sub page

Top Level Page – Second Level Page — Child Page — Child Page — Child Page The goal here is to list all children of second level, I have that done from the codex. However, when I click on a Child, the children should still display because we’re technically still inside of the Second Level. <?php // Globalize the $post variable; // probably already available in this context, but just in case… global $post; wp_list_pages( array( // Only pages that are children of the current page ‘child_of’ => $post->ID, //…

Transition from Draft to Scheduled Post with wp_update_post

I am trying to transition my post from a Draft status to a Scheduled status in the future. Here is my code to do that: if($save_as_draft == « yes »){ $post_status = ‘draft’; $post_date = date(‘Y-m-d H:i:s’); }else{ $future_date_post = $_POST[‘future_date_post’]; if($future_date_post== »yes »){ echo « it is in here »; $post_status = ‘future’; $date_time = strtotime($_POST[‘post_date’]); $post_date = date(‘Y-m-d H:i:s’, $date_time); }else{ $post_status = ‘publish’; $post_date = date(‘Y-m-d H:i:s’); } } $bmt_post = array( ‘ID’ => $post_id, ‘post_title’ => wp_strip_all_tags( $title ), ‘post_content’ => $information, ‘post_status’ => $post_status, ‘post_category’ => array( $cat_ids ), ‘post_date’ =>…

An opinionated guide to React.js best practices and conventions

I’ve been using React.js for a little while now, both in my 9 to 5 job and for my own projects, and during that time I have started evolving my own set of React.js best practices. The following guidelines mostly focus on component structure and JSX. However, they are not hard and fast rules, but more of an opinionated set of guidelines I choose to adhere to that make my code more readable, more robust and easily maintainable. Note: This article does not provide explanations of the React paradigms or…

Web Design Weekly #170

Headlines A Vision for Our Sass A cracking post by Felicity Evans that covers some of the current difficulties with Sass and how to best approach them. (alistapart.com) Master Version Control with Git The best Git client for Mac. Trusted by over 40,000 users in companies like Apple, Google, Amazon, and Twitter. Try it for free for 30 days! (git-tower.com) Articles Strategies for getting feedback (and not hating it) The talented Jonas Downey gives us a look behind the scenes of how his team captured invaluable feedback whilst working on…

Multisite wp-admin redirect loop

I have a subdirectory multisite setup, it all works fine apart from one small issue… The sites are setup in the following structure: http://domain.com/blogs/ http://domain.com/blogs/second/ http://domain.com/blogs/third/ You can access the admin panels if you use the following: http://domain.com/blogs/wp-admin/ http://domain.com/blogs/second/wp-admin/index.php http://domain.com/blogs/third/wp-admin/index.php But if you use the following (as wordpress does in the dashboard), then it gives a redirect loop? http://domain.com/blogs/second/wp-admin/ http://domain.com/blogs/third/wp-admin/ It seems there is some sort of redirect just when index.php is not specified on the subfolder installs, what is causing this?! This multisite setup was setup in WordPress 3.9.1…

Page with the same name of a category

I’ve a category, let’s say « testcat ». I want to create some pages which the final url should be « http://example.com/testcat/pagename« . To do this, I should create a page named « testcat » and then a page named « pagename » with the page « testcat » as parent page. I tried and it seemd to work, but I’m worried about what’s happening in the backend as actually there should be TWO pages on the same url http://example.com/testcat/: the default category page for « testcat » category and my custom page « testcat ». Could you help me to understand if this…

How to know what submit button the user clicked?

I’m working on my settings page, I want to add two different buttons to the form and do something different depending which the user clicked. The documentation states I can create two buttons like this: submit_button(‘Submit’, ‘primary large’, ‘primary’, false); submit_button( ‘Delete’, ‘delete’, ‘delete’, false ); However I don’t understand how to differenciate when the user clicked each one, it seems that no matter which button clicked the form is submitted the same. How can I do something different depending what button the user clicks? Source: https://wordpress.stackexchange.com/feeds

GSS: Layout Reimagined

Layout on the web is certainly an extremely time consuming process and the most outdated. Floats and such still don’t cut it. At it’s core, Grid Style Sheets (GSS) reimagines CSS layout and harnesses the Cassowary Constraint Solver – the same algorithm Apple uses to compute native layout. OK sounds good, but is it a pre-processor? Well… no not exactly. GSS enables far better layout control through building relational rules between different elements. Let’s take CSS and bend it to our will as we look into the layout capabilities of…