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
- Show success or error messages in Ajax response to WordPress custom registration form
- Styling my own password protected page, how to deal with wrong password?
- Contact form won’t submit
- wp_mail file attachment not being placed in upload folder?
- Search Query: how to construct a search string from two select elements?
- Login to wordpress by clicking a link and specifying usernaname and password in url
- Databases – Submitting data from inputs to database [closed]
- How to show a ‘correct’ message after submit a form?
- get_the_title() gets printed out twice
- db converts decimal number wrong
- Form Security: nonce vs. jQuery
- How do I find PHP file that contains content of my page?
- WordPress admin-ajax.php 400 bad request
- WordPress page content outside WordPress
- Using the_excerpt() on a page
- Inject class in body when particular page template is used
- Use .php file as page instead of wordpress page & template file?
- Use WordPress function in php file
- Ajax contact form return 0
- Trying do build a contact form
- “operation successful” message
- 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
- Search WordPress using static html page
- How to check if the current page is at a specified path in the URL?
- Show About and Contact Us page when they’re clicked in the top menu.
- How to execute html code inside php?
- Parsing Menu Items and Blog Posts
- How to use theme function in post/page?
- My php code is not being executed
- How to put a form with php code into a variable or shortcode?
- trouble with page_id & highlighting current page
- Apply class to every third list item? [duplicate]
- How to include custom code on a page that’s set to act as homepage?
- What’s the best way to include PHP code in pages?
- How to send form data from WordPress (Meta Box) to an OData service?
- Automatically add images to a menu
- What is the alternative code to if (isset ($_POST) && !empty ($_POST) to avoid warnings?
- WordPress shortcode returns the data before
- page-slug.php not working but only for specific slug
- Shortcode to embed Edit Account form not working
- Form Submission Not Working In Custom Theme
- Need php code’s output to display underneath a Divi Module
- Insert page content into another page with a changed variable
- Capture form data in one function and use it in another function (same file)
- How to echo every parent page title?
- How Do I Find & Remove H1 From Site-Title-Wrapper? [closed]
- How to display success message correctly and delete it when the page is refreshed
- Using admin-post.php for admin form but it directs me to admin-post.php white screen
- Why does my user not get added to the database on custom registration?
- Retrieve Json data and create multiple pages with it
- Submitting a form, using Ajax, to run a SQL Select query based on user input from the form
- How to add post meta in while loop?
- How to add page numbering with php?
- Display child page content of a specific parent on home page
- Noindex subscriber author page
- How to set cookies
- PHP Contact form
- Get wp_current_user_id using PHP and MySQL
- Removing custom sort order from admin page listing
- Adding Additional Variables on Menus Page
- form built dynamically with php, not submitting
- PHP- Why is my contact form keep showing it is invalid? [closed]
- Simple php in wordpress widget [closed]
- PHP Output also in Child theme, but different
- Search only working on front page (index) , not working on other pages
- $wpdb->get_results breaking page?
- form $_post action value gets truncated after it passes through two forms
- Unique PHP on each Page
- Pass important values server-side when processing form
- How to Display a List of Child Pages For a Parent Page in WordPress
- WPDB secure custom form
- Adding attribute to the post.php form tag in wp-admin
- How to make blog post entries appear as input form instead of just text?
- If is page, archive or search output this code
- Adding data to custom wordpress database table
- Make a page (url) not cacheable [closed]
- WordPress Search
- List all anchor links on a page
- Front end file upload returning wrong attachment url
- Toolbar Hidden in a Virtual Page
- WordPressUser Submission Form
- Display multi-select box choices in a bullet list [closed]
- Page Options Saving But Not Updating In Backend
- How do I add my PHP app to a WordPress page whilst keeping semantic URLs?
- What should I write in the post action of this front end post form?
- Page load timer?
- Custom forms with HTML
- Testing a Form’s Zipcode Field with Regular Expressions to Determine WordPress Page Behaviour
- Contact form – problem with displaying message about sent mail
- Page not visible in ‘All pages’ after being added through PHP
- Using Ajax to submit a form, and run a SQL Select query based on user input from the form
- Edit and delete permissions pages and posts
- My worpress search page is showing no results
- A function to get the content of a page
- HTML Form Question
- WordPress Custom Form – Getting Query Vars, Weird Glitch?
- $_POST returning empty values
- Trying to update Woocommerce meta values