Fatal Error Call To Undefined Function Php Do_shortcode
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Shortcodes breaking Wordpress Site up vote 0 down vote favorite 1 I am creating new shortcodes for Wordpress on my local version of a Wordpress website. In functions.php, I am adding for example: function shortTest() { return 'Test for shortcodes '; } add_shortcode('shortTestHTML', 'shortTest'); Adding the function only is OK, but when I add the add_shortcode() portion, I get a major issue. It breaks something somehow and I get 500 errors, meaning I can't even load my website locally anymore. Any thoughts??? Thanks so much! EDIT: From PHP Error Log: [21-Jun-2011 19:02:37] PHP Fatal error: Call to undefined function add_shortcode() in /Users/jonas/Sites/jll/wp-includes/functions.php on line 4505 php wordpress shortcode share|improve this question edited Jun 21 '11 at 20:35 asked Jun 21 '11 at 19:24 jonasll 1781320 And what is the error message that PHP throws on you? Check your PHP error log. –LazyOne Jun 21 '11 at 19:36 [21-Jun-2011 19:02:37] PHP Fatal error: Call to undefined function add_shortcode() in /Users/jonas/Sites/jll/wp-includes/functions.php on line 4505 –jonasll Jun 21 '11 at 20:34 add a comment| 6 Answers 6 active oldest votes up vote 4 down vote accepted 1) Make sure that you have included shortcodes.php file somewhere (for example, in wp-load.php or whatever other more appropriate place may be). require_once( ABS
(of 11 total) Author Posts May 30, 2013 at 8:25 am #23960 JudeAAZParticipant Hello, I've an error when inserting php function for layerslider in my php theme files : "Fatal error: Call to undefined function layerslider() in …" I inserted it like , the good way I think. Thanks for helping me. May 30, 2013 at 10:29 am #121784 JudeAAZParticipant Nobody use php function for displaying slider in homepage ? May 30, 2013 at 11:29 am #121785 JudeAAZParticipant I've found the BUG ! Happened when : - creating a new page ; no content inside - set this page as "A static page" in the Front page displays in "Settings > Reading" Because there http://stackoverflow.com/questions/6430855/shortcodes-breaking-wordpress-site has never been a slider shortcode inside the page content, "ShortcodeHelper::$tree" is empty and not an array. So the function "post_has_layerslider" return always "false". How do I solve this temporarily ? I inserted a layer shortcode inside page, I updated, and I deleted it just after. It seems that Avia keep in memory "av_layerslider" also when there is no more slider in page content. May 30, 2013 at 2:28 pm #121786 DudeModerator If you want to http://www.kriesi.at/support/topic/layerslider-in-php-file/ use php to call the slideshow (which imo doesn't make much sense) you can try the do_shortcode function: echo do_shortcode('[av_layerslider id="3"]'); Instead of 3 insert the id of your LayerSlider. May 30, 2013 at 2:41 pm #121787 JudeAAZParticipant Why it doesn't make sense ? You have created php function to display the slider in php files, so I use it ! PHP function "layerslider(xxx)" does the same as "do_shortcode(…)", I want to use the best way to display my slider on homepage. How do you manage this with the slider in demo ? May 30, 2013 at 3:39 pm #121788 DudeModerator We just use the advanced layout builder on the demo website. You can use the code from here: https://gist.github.com/InoPlugs/5d0d1477a0252aca1081 to reproduce the front page layout - just insert it into the "standard editor" and save the page. Then switch to the "advanced editor" to edit the elements. June 1, 2013 at 5:15 pm #121789 JudeAAZParticipant No I don't want to use this method, I want to use the method you've planned for theme's php files (I'm a developper so inserting a lot of shortcodes inside editor is not the best way for me) June 1, 2013 at 8:25 pm #121790 DevinModerator Hi JudeAAZ, I have no idea where you got the idea that the theme somehow wants you to write php to make
Hi, This happens on a fresh WordPress 3.8.1 install when trying to login. Entire message : Fatal https://community.theme.co/forums/topic/fatal-error-call-to-undefined-function-x_has_shortcode/ error: Call to undefined function x_has_shortcode() in /homez.532/obcreati/www/wp-content/plugins/x-shortcodes/setup.php on line 68 Thank you for your help. Laurent. January 30, 2014 at 1:22 am #9564 KoryKeymaster https://github.com/wp-cli/wp-cli/issues/1586 Laurent, You do not have the X Shortcodes plugin installed, which is required for the theme to run. Please ensure that you have this in fatal error place. Thanks! January 30, 2014 at 1:22 am #9565 KoryKeymaster This is also covered in our Knowledge Base here. January 30, 2014 at 1:55 am #9566 Laurent FParticipant Hi, The X shortcode plugin is installed as you can see inthe options table : a:10:{i:0;s:51:"all-in-one-wp-security-and-firewall/wp-security.php";i:1;s:53:"codestyling-localization/codestyling-localization.php";i:2;s:36:"contact-form-7/wp-contact-form-7.php";i:3;s:59:"force-regenerate-thumbnails/force-regenerate-thumbnails.php";i:4;s:27:"js_composer/js_composer.php";i:5;s:23:"revslider/revslider.php";i:6;s:41:"rvg-optimize-database/rvg-optimize-db.php";i:7;s:27:"updraftplus/updraftplus.php";i:8;s:41:"wordpress-importer/wordpress-importer.php";i:9;s:22:"x-shortcodes/setup.php";} I manually descativate thru PhpMyAdmin the ‘All fatal error call in one WP securtity and firewall' plugin and now I can log to the admin panel. I have other website with the X theme and the ‘AIOWP' plugin but for this installation, I started with the ‘AOIWP' plugin and the the X theme. Si I'm going to unistall everything and start a new installation the other way !! I'll let you know. Thank you anyway. Laurent. January 30, 2014 at 1:57 am #9568 KoryKeymaster Sounds great, Laurent. Let us know how it goes. January 30, 2014 at 3:31 am #9585 Laurent FParticipant Hi, That was the reason. One of the setting of the ‘AIOWP' plugin might be really to restrictive and the X shortcode install was completed but bad !!! I guess !!! Have a nice day again. Laurent. January 30, 2014 at 6:31 am #9607 RubinKeymaster You're welcome! Author Posts Join the conversation Register or login to your
Sign in Pricing Blog Support Search GitHub This repository Watch 170 Star 2,979 Fork 597 wp-cli/wp-cli Code Issues 40 Pull requests 2 Projects 0 Wiki Pulse Graphs New issue Fatal error: Call to undefined function add_filter() in phar:///usr/local/bin/wp/php/wp-cli.php(23) : eval()'d code on line 91 #1586 Closed simplenotezy opened this Issue Dec 23, 2014 · 5 comments Projects None yet Labels state:unconfirmed Milestone No milestone Assignees No one assigned 2 participants simplenotezy commented Dec 23, 2014 I am trying to follow this guide: https://github.com/wp-cli/wp-cli/wiki/Plugin-Unit-Tests But when running: wp scaffold plugin-tests my-plugin It fails, and outputs: Fatal error: Call to undefined function add_filter() in phar:///usr/local/bin/wp/php/wp-cli.php(23) : eval()'d code on line 91 Running latest version of both WordPress and wp-cli (as I just installed it). wp-cli member danielbachhuber commented Dec 23, 2014 Can you copy and paste the contents of your wp-config.php file, minus any secrets? danielbachhuber added the state:unconfirmed label Dec 23, 2014 simplenotezy commented Dec 23, 2014 Here, running localhost (with mamp):