WordPress Custom post type require my file
I am building a plugin that will create a bunch of custom types of posts.
The plugin will connect with an external API for different functions.
For that, the settings page requires the API login form.
All I want is in the admin area, when they will click the custom types pages to be required by the same api login form.
Where should I place the expression
<?php require('api_login.php'); ?>
for the custom type pages?
Is there a way to make it in the functions?
Please be aware that the plugin will be given away and I will have no control on the other native files of WordPress platform.
No. The expression must be in every file where I need to call the login.
Found that later.
Accessing $wpdb in new Wordpress PHP file, "require wp-load.php" NOT working
Alright, I've been pretty frustrated with accessing $wpdb in a new PHP file in WordPress. Now, I've gone through and read all the answers I could find on the situation, and they're all universal in saying that all I need to do is add wp-load.php at the top of my php file which uses $wpdb and it should work. I've done that... However, it still isn't...
Wordpress functionality plugin how to require file elsewhere on server?
I need to require_once() a file in my Wordpress functionality plugin which resides at home/me/vendor/ on the server. Wordpress of course is in www/html. Can someone direct me on how to define the path to the required file? Nothing I try seems to work. The first echo displays as expected (just a test). The second one does not so, for starters, I thi...
Require file in functions from theme directory using PHP
I am trying to dynamically get the facebook php sdk from my current themes folder. I am writing this in my functions.php, but all my attempts break the site. See my attempts below... Can any one help me understand why this does not work? Thank you very much.
How do I require a file in a shortcode?
I have a shortcode that is working and displaying the problem is that it jumps to the top of the page. If I have any text or other shortcodes above it in the page editor they will be displayed below this one on the front end. There is about 259 lines of HTML in the shortcode_file.php file that is why I am doing it this way rather that just having i...