G
G
Grizar2019-09-09 17:50:39
WordPress
Grizar, 2019-09-09 17:50:39

How to allow php?

WordPress site.
We create a MENU through the admin panel. When adding a MENU ITEM, if we insert either a shortcode or a PHP code into the title bar, it is not executed. The shortcode is displayed when viewing the site simply as text, and PHP is not displayed at all, but is commented out in the markup.
How can I make it so that when adding a php code or a WordPress shortcode to the MENU (in the admin panel, in the item name) , WordPress allows their execution.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Daria Motorina, 2019-09-09
@Grizar

One of the reasons WordPress shortcodes exist is to protect against left-hand code execution, and not just a user-friendly way to add functionality. You can not create the ability to execute naked php from the content - this is a vulnerability.
Most likely, the shortcode is not embedded in the menu generation code in any way, try plugins ( example ) so as not to crutch.

R
Randewoo, 2019-09-09
@Randewoo

In general, in the Russian Federation PHP is prohibited at the legislative level.
But you can cheat the law, if you have nginx, then correct the line:
To:
If Apache, then I'm sorry, here my powers are all powerless.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question