A
A
Aristotel Paskalov2021-02-14 11:15:21
IDE
Aristotel Paskalov, 2021-02-14 11:15:21

How to make VS code understand Wordpress code?

I'm learning to pull the layout on Wordpress.
All code is highlighted in red:

6028dbc984155128871139.png

There are no errors in the code.
As far as I'm guessing, the IDE doesn't recognize the Wordpress code.

Here is what is displayed in the terminal:

6028dc0b0d854907768593.png

Can you please tell me how to fix this?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
H
HemulGM, 2021-02-14
@HemulGM

What else is "Wordpress code"? What did you come up with? This is normal php.

P
Pychev Anatoly, 2021-02-14
@pton

In fact, as already suggested, this is a regular php.
Therefore, it is necessary to approach both php.
Personally, I have the PHP Intelephense
extension. To make it convenient to work and not have a clutter of directories, you need to use the workspace, i.e.
- Add your working folder.
- Add the working folder where wordpress is installed as a separate folder. It is desirable to have a separate copy of WP on disk, then the search will not be duplicated
. As a result, there is a general search, there is a search in directories, the transition to the function definition works.

E
evilgazz, 2021-06-29
@evilgazz

Just throw the entire wordpress folder into vscode and it will automatically pull up all the core functions. No add-ons need to be installed.

L
Leonid Rozhentsev, 2021-02-14
@RLeo777

Install a WordPress plugin. The latest version of vscode has them

A
Anton, 2021-02-14
Semenov

Vscode is NOT an IDE, it's a code editor like notepad++, it's just cooler because there are a lot of extensions.
Even in phpstorm you need to add plugins in order for the functions and hints for wordpress to work properly. The same applies to other frameworks or cms.
But by screwing a few extensions, you can make it so that everyone understands
. For example, like here: https://marketplace.visualstudio.com/items?itemNam...
Inside there are links to additional extensions
Here is also an interesting reading: https://github.com /WordPress/WordPress-Coding-Stan...
wordpress, like php itself, has not been so simple for a long time... especially if you want to write modern, correct code according to standards.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question