Problems wp_insert_post and save_posts filter

you can check what post type is calling the ‘save_post’ action try: public function save() { global $post; if (!$post->post_type=”video”){ $my_child = array( ‘post_title’ => $this->_child_type, ‘post_content’ => “test content”, ‘post_status’ => ‘publish’, ‘post_type’ => “video”, ‘post_parent’=> 55 ); $nindex = wp_insert_post($my_child); } } add_action(‘save_post’, array(&$this, ‘save’));

How to know where this function definition is declared?

To answer your other question, about the two types of passwords stored in the database: Up until version 2.5, WordPress stored passwords encrypted with the MD5 hashing algorhythm. MD5 is nowadays considered to be poor security – with moderately-priced off-the-shelf GPUs, it takes less than a hour for a program to brute-force all possible combinations … Read more

How to access variables from Functions file in theme files

Whilsts @Shaon’s answer is perfectly valid, I’m of the opinion you really shouldn’t be throwing configuration settings around as global variables – use a constant instead. /* Constants are in the global scope, but can only be defined once. */ define( ‘FEEDBURNER_USERNAME’, ‘my_username’ ); define( ‘FEEDBURNER_PASSWORD’, ‘my_password’ ); If the variable needs to be dynamic … Read more

How do I find PHP file that contains content of my page?

You are under a fundamentally wrong assumption: The content you input via the administrative back-end does not live in a file, but in the database, specifically in the wp_posts table. Do not be misguided by the table’s name, a “page” is technically a post of type page. If you attempted to find the content you … Read more

Form Security: nonce vs. jQuery

jQuery is a js library not a transport protocol, your data is sent via GET or POST, wether you use jquery or not. Think of it like this, sometimes it’s the user in the first frame, sometimes it’s javascript: Firstly nonces are not the same as sanitisation, they have different purposes Sanitisation is about verifying … Read more

WordPress SQL injection

The insert method of $wpdb already scapes the data taking care of SQL injection. What you should worry about is about data sanitization and validation. For exmpla: Sanitization What type of data do you accept in $votes? A integer value? If so, be sure $votes contains a integer value. You cuold do it, for exmaple, … Read more

Security: blocking direct access of php files

In my opinion, the only way to do this (within the context of WordPress) is: if ( ! defined( ‘ABSPATH’ ) ) // Or some other WordPress constant exit; The second technique is vague and does give the same level of checking (it only checks that the filename of the main PHP file matches itself, … Read more

Can you use a WordPress front-end only and have rest of pages as pure PHP

It is a little hard to grasp how much of WordPress you really want to replace. WordPress at front-end will typically take care of following steps: parse the requested URL (typically “pretty”) determine the current context of request (query variables) query the required set of posts determine and load which theme template fits bets proceed … Read more