Natively WordPress posts are subset of HTML (even more like semi-HTML – paragraph tags can be implied and added on output, but not stored). As result it really really doesn’t like to store or process active code in post’s content. This applies both to internal logic in PHP and front-end logic of post editor (it actively tries to strip some things like iframes, when switching to visual editor, etc).
Basically you have two options:
- Loosen restrictions on what can be input and sotred in post content – like Exec-PHP you mention in question.
- Store active code elsewhere (in custom fields for example) and use shortcode in post content to call it.
Related Posts:
- Can I use the same nonce for multiple requests on the same page?
- WordPress and magic quotes
- Reposition WooCommerce breadcrumb outside of wrapper content
- WP E-commerce: Showing 3 random products from current category when viewing product
- How can I pass a variable to wp_ajax action?
- Comparing arrays within a loop
- Real time Duplicate title check
- Load custom field value into div with AJAX
- Jquery ajax to custom php file: returning blank data
- Accessing a random image via ajax
- Making a follow button, Ajax not talking to php
- Display notification only once
- admin-ajax.php returning error 400 namespaced callback
- Ajax form submit within a Post Metabox
- WordPress File handle – fopen, fwrite not working with $.ajax or $.post Jquery
- Stumped – Ajax Response Returns 0
- doing an ajax request always outputs 0
- Shortcode button dosent work for all posts. Work for first post only
- Any possible way to make $wpdb->get_results() return anything else than array?
- wordpress count link clicks by ip address
- WordPress plugin/code to hide all things related of a user from the public
- WordPress ajax doesn’t display object method on jQuery .change() function
- Problem with custom plugin using AJAX to pull info from php file
- Ajax random number always the same
- Call a PHP Function with Multiple Parameters that is outside the AJAX Handler
- Repeating admin-ajax.php not found error in admin
- Is it possible to intercept all ajax requests and get the parameters and the returns?
- How to send Ajax request from my plugin in admin dashboard?
- Refresh table data with Ajax
- admin-ajax.php warning max input vars exceeded on layered pop plugins [closed]
- get_children displaying images removed from the page
- AJAX success response is not working but it’s saving my changes
- How to disable controls in theme customizer?
- How can I hide that I Use WordPress (with W3 Total Cache)
- WooCommerce Tabs [closed]
- WordPress Ajax Call inserting data but success response false
- Loading php file with AJAX in WordPress frontend
- Get the URL of the page from which an ajax request has been launched within ajax callback
- AJAX button action in foreach
- WordPress ajax-action failing because of newline in response
- Making an AJAX call to refresh a table
- Using data sent via AJAX in multiple functions on a WP plugin
- load ajax using admin-ajax.php
- Ajax button not working
- Simple AJAX notification when the new post is added to the database
- Is it possible to create new user from external form using REST API?
- coding a WordPress AJAX Form using PHP to check if User is Logged Out and Show error
- When echo follow Ajax button inside Ajax pagination template not working?
- jQuery Ajax PHP function call returning [object Object]
- Calling PHP Scripts in Ajax that are in PHP Snippets
- Asynchronous request in wordpress
- Retrieve Json data and create multiple pages with it
- Loading Posts & Category with Ajax
- Simple jQuery AJAX Request fails to run PHP Script
- PHP Warning: Missing argument 2
- Allow user to Upload image and manipulate it on the frontend
- Plugin not working locally, but works on server
- How to SELECT number from table and use in calculation . Unsupported operand types
- Execute Jquery when a specific page in my plugin is loading
- AJAX function not working [closed]
- How to load previous or next attachment with jquery ?
- Validating an email input from form field before submit using JQuery, AJAX, and PHP
- custom add note meta box with add button in wordpress
- can’t unzip file
- Disclaimer that will show every refresh of the page
- Ajax on the Administration Side of plugin – wp_localize_script – how to pass value from JQuery to PHP function in class?
- How do I make these combination select filters work when only one dropdown is set? They work in WordPress 5.8.2 but don’t in 5.8.3
- duplicate posts with ajax load more wordpress
- Failed to load resource: the server responded with a status of 500 (Internal Server Error) through wp_admin_ajax.php
- Change ajax live search results
- Ajax filter with loadmore button
- Update $wpdb query with AJAX
- How to use Datatable with Ajax when creating plugin on WordPress?
- AJAX and custom pages
- $.ajax results in 403 forbidden
- AJAX to add to cart multiple products woocommerce
- autocomplete in wordpress using ajax with json-data
- How can i get the same ajax result using WP REST API instead of admin-ajax?
- Remove item from post_meta array via AJAX
- wp_send_json erase last value
- defined (‘ABSPATH’) false after AJAX post to other PHP-file
- Help with customising love it plugin (use within foreach)
- AJAX Filter WHILE Loop not working WordPress
- wordpress ajax pagination
- Why I’m Not Having Access to “$_POST” Data Outside My AJAX Callback?
- Ajax call URL 404’ing when pushed to staging server
- 500 (Internal Server Error) of external php file
- Use jQuery and AJAX to get HTML
- WordPress Pages into Sections edit.php PHP hack
- Loading a post’s content, into a div outside the loop, when it’s title is selected in a list
- WordPress: Create A Widget to Accompany Plugin
- PHP Syntax getting PHP terms
- Cookie not created in AJAX request
- Get Products within Current Product Category
- WordPress portfolio pagination on home page
- notify users when changed database
- Save Edit button then disabled readonly metabox
- getJSON response to PHP
- WooCommerce Modal Fly cart on add to cart – With AJAX
- Display posts based on the selected category when no subcategory is chosen