…ajax calls can’t show shortcodes because of the admin ajax url that they dont have full access to wordpress enviorment
Not true. AJAX calls have exactly the same resources at their disposal as regular WordPress requests. Just make sure to parse the content in the same way the_content()
does:
$parsed_content = apply_filters( 'the_content', $post->post_content );
Update: Your code is a mess, try this instead:
function prefix_load_proyect() {
if ( ! isset( $_POST['proyect'] ) || ! $post_id = absint( $_POST['proyect'] ) )
return;
if ( ! $post = get_post( $post_id ) )
return;
echo apply_filters( 'the_content', $post->post_content );
exit;
}
Related Posts:
- Loading shortcode with ajax
- Calling shortcode in wp_localize_script strips result
- Only execute jQuery function(on document ready) on the page has shortcode from plugin [duplicate]
- Shortcode in AJAX popup
- How to put JQuery/Ajax inside shortcode?
- Making sure that a plugin’s scripts and stylesheets are included for dynamicaly loaded content
- Render Modula Plugin Shortcode On Ajax Request
- grab or load text on demand
- JS working when used normally but not in wordpress
- Get shortcode attribute for AJAX call
- How to load a plugin when doing an Ajax call? [duplicate]
- How can I make an Ajax login form work with FORCE_SSL_ADMIN enabled?
- Help making my pagination plugin better
- admin-ajax returning 400 error when request is made with Fetch API
- Adding Custom Fields for Img in Posts
- Shortcode display outside the div
- Errors while using ajax from external wordpress page
- shortcode doesn’t work
- Built in admin ajax hooks?
- Layout shop page: resize images and columns
- How to add inline css/js inside a shortcode
- How extend shortcode default values for a plugin?
- Ajax with jQuery UI dialog not working
- Can I use a Shortcode output as an HTML attribute value?
- WP theme with Backbone
- $wpdb working with ajax but showing ajax error instead of success
- Why none of the plugins that have ajax doesn’t work in my website?
- Force [wordpress_social_login] shortcode to display where it is embedded [closed]
- Why do plugins that cause ‘unexpected output’ create AJAX problems?
- tag breaks shortcode output (other solutions don’t work)
- Allow users of my plugin to define their own shortcode rather than use mine?
- WordPress Ajax Posting from App
- Why WordPress plugin url ajax doesn’t work?
- creating html reusable blocks via shortcodes
- add_shortcode is not working in plugin where others are working
- Ajax call returning 0
- Ajax fail and get 504 error
- Some code in shortcode function being ignored
- plugin shortcode output
- How to Create a shortcode to this php function
- What is @Action in WordPress?
- Where are theme codes located for WordPress?
- How to have sample page for each new register users in a membership website
- Submit Form data to another page via Ajax (WordPress Way)
- using do_shortcode
- wordpress add_action() issue in ajax call
- How to activate a plugin on the activation of a theme?
- Ajax Plugin Not Echoing Response
- WordPress Ajax code is not Working
- IF condition based on wp_remote_get output
- shortcode not return any thing in Gutnburg
- Shortcode not working – quotes seems strange
- Where Should i write the code for wordpress ajax voting?
- Get Image Having the ID [closed]
- Add the_post_thumbnail_url to a shortcode in function.php
- How to include my Ajax calls in one function instead of calling different ones every time?
- Form Plugin for Api Requests which is used via Shortcode
- Echo out element to another page.
- Adding a Tag Parameter / Filter to My Shortcode
- Filters on the_content with plugins, pages and shortcode
- Using AJAX to run SQL statement and populate dropdown
- Which is a better practice when writing shortcodes: pack lots of configuration parameters or just give an id?
- Need help creating asynchronous data scraper in WordPress
- Ajax call not working in wordpress through a plugin
- Ajax 400 error when used inside a plugin
- Strange admin-ajax / CSS / $_SESSION issue
- In a plugin, How to update a json file using ajax
- Can you add a shortcode to a custom post type that gets the post_title, post_content, etc. and then passes that to a plugin function?
- Make the product page as homepage WooCommerce
- Image path in childs theme
- Shortcode function not showing up on mobile browser
- wp-admin/admin-ajax.php 400 (Bad Request) plugin
- Get Current Post ID in WP Loop For GiveWP
- AJAX update fails for public/non-admin users
- WordPress Ajax request “Failed to load resource: the server responded with a status of 400 ()”
- Shortcode generated widget to appear on same line as heading text and button
- Page takes on two different formats
- Conditional Fields depending on checkboxes
- Sanitize AROUND shortcode
- Ajax call fails and returns [object Object]
- wordpress ajax pagination object value does not change
- Sending post data over REST API, how to parse shortcodes in post_content?
- shortcode which is introduced into entry the blog, and appears in side bar
- What’s the preferred method of writing AJAX-enabled plugins?
- using jquery serialize in ajax operation for plugin
- Like/Dislike Bar not working when updating
- Space in WordPress Attribute Causing Problems
- Shortcode registered from a plugin not recognized
- Strange get_the_* behavior with php 5.4
- Trouble Removing Plugin [closed]
- How to change response of admin-ajax request?
- Ajax not working for logged in users
- Embedding BitBucket Code in Posting
- Do shortcodes affect page indexing by search engines?
- How to show in front End images using Visual Composer attach_images?
- Seo Problems in My meta Discription [closed]
- Ajax Called in Plugin php file
- Subtract Using GravityWP Count Plugin
- Ajax Load More stopped working (Plugin with repeater template, shows hidden Button)
- Shortcode cannot parse attributes within double quotes. ” is becoming ” breaking my shortcode