You can’t use PHP in the WordPress back-end editor. Maybe with a plugin you can, but not out of the box.
The easiest solution for this is creating a shortcode. Then you can use something like [input type="text" name"from"]
in your editor.
function input_func( $atts ) {
extract( shortcode_atts( array(
'type' => 'text',
'name' => '',
), $atts ) );
return '<input name="' . $name . '" id="' . $name . '" value="' . (isset($_GET['from']) && $_GET['from'] ? $_GET['from'] : '') . '" type="' . $type . '" />';
}
add_shortcode( 'input', 'input_func' );
Related Posts:
- Cascading dropdown select search based on Parent Page & Child Page
- Sending the reset password link programatically
- How to stop form resubmission on page refresh
- How to add a .php file to WordPress
- add_filter the_content str_replace after shortcode
- How to check if feed URL was requested?
- How to insert PHP code in a WordPress Post
- How to change “Shipping Calculator “field label on Cart Page – woocommerce? [closed]
- Creating wordpress user registration form
- How to link to a custom .php page in my folder
- Get only the grandchildren, not the direct children of page/current page?
- Passing POST data from one WP post to another
- How to group 2 radio buttons in a widget?
- Ajax form submit within a Post Metabox
- How to create and work with custom data / tables (i.e., for arbitrary data)?
- Custom category code not showing all posts
- Upload Image in a WordPress page using PHP
- Get Admin Email Address From External PHP page
- Can’t get page content in WordPress
- How can I load a PHP page without using a Template?
- How to create a form and display its content as table in admin panel?
- My form action url is being prepended with a directory that does not exists
- Best practice for migration friendly images in posts/pages?
- Page Automatically Generated from Theme?
- How to hide all child pages with post_query?
- How can I reuse the code to capture a param in a URL and place in a value in a hidden form?
- Populate editor with some content of a page with a page template
- How to pre populate a form field with a link of a current user’s author profile?
- How to get the value of input hidden html from text editor to custom page template?
- Create Page To Count Comments For Each Post In WordPress Site
- Show success or error messages in Ajax response to WordPress custom registration form
- Contact form won’t submit
- wp_mail file attachment not being placed in upload folder?
- get_the_title() gets printed out twice
- Form Security: nonce vs. jQuery
- Using the_excerpt() on a page
- Trying do build a contact form
- Why am I getting a different filename? And how does WordPress load singular.php for both Page & Post? (Fresh WordPress installation)
- User register hook is not working in woocomerce register form
- Show About and Contact Us page when they’re clicked in the top menu.
- How to use theme function in post/page?
- My php code is not being executed
- Apply class to every third list item? [duplicate]
- How to include custom code on a page that’s set to act as homepage?
- How to send form data from WordPress (Meta Box) to an OData service?
- WordPress shortcode returns the data before
- Form Submission Not Working In Custom Theme
- How to echo every parent page title?
- Why does my user not get added to the database on custom registration?
- Retrieve Json data and create multiple pages with it
- How to add post meta in while loop?
- Noindex subscriber author page
- How to set cookies
- Removing custom sort order from admin page listing
- Simple php in wordpress widget [closed]
- $wpdb->get_results breaking page?
- Pass important values server-side when processing form
- Make a page (url) not cacheable [closed]
- List all anchor links on a page
- Display multi-select box choices in a bullet list [closed]
- Testing a Form’s Zipcode Field with Regular Expressions to Determine WordPress Page Behaviour
- Using Ajax to submit a form, and run a SQL Select query based on user input from the form
- My worpress search page is showing no results
- $_POST returning empty values
- How to send custom form submissions to WordPress Database?
- Custom PHP form needs refresh to load page correctly
- I want it to detect the duplicate comment and give a warning on the same page
- Confuse between forms and tables
- custom search query database in child theme
- Using transients to store form notifications
- Insert data from form to database
- not able to access $_POST on backend profile update
- Getting page / post URL on publish and / or update
- Custom Plugin Develoment, Form Action
- wordpress form action page not found
- Trouble with checked() for array of multiple checkboxes
- Custom HTML form using PHP – help with ajax/username validation
- Form direction to .php on localhost
- Form not working as it should in WordPress, but in a normal HTML site it does
- Ajax call URL 404’ing when pushed to staging server
- Update only some custom user fields
- Dynamic form variables for post meta
- Replace content in WordPress Page after GET from php page
- List of child pages fetch next results at link click
- How to use PHP code with wordpress page
- Headers for Contact Form are wrong
- Using Nonce for my Form
- Trying to put a search page on site
- I want Page titles and excerpts to show up on home.php in certain order
- ACF: Echo page title when checkbox is checked
- Create a custom page URL
- Hide page title
- I can’t seem to get excerpts showing inside get_pages and don’t know why?
- How to pass username into form that sends data to database
- HOW TO Insert Existing PHP Code to WOrdPress
- Forbid certain users to access a specific page
- How to return a Boolean for a page that is a subpage thru its name?
- Where to put include php file?
- Create an if statement based on page_id
- Redirect loop upon installation of my plugin