Skip to main content
added 24 characters in body
Source Link
Lee
  • 155
  • 2
  • 15

I am trying to run a script when a user publishes / updates a post.

I am using the filter: wp_insert_post_data

The problem I am having is the script is a php file outside of WordPress but on the same site (It works fine if i go direct to it) that just needs to be run. I tried to include the file using the filter but that stopped the post being updated for some reason.

This is my current code:

function updateFeed( $data , $postarr) {
   include 'jobsfeed.php';  
   return $data;
}

add_filter( 'wp_insert_post_data' , 'updateFeed' , '99', 2 );

Is there any way to be able to run this script?

EDIT:

It does seem teh file is being run but for some odd reason it is not outputting the custom field values. It is a simple php file with a loop using wp_query and it works fine when I go direct to it. - any ideas what it could be?

EDIT:

Figured out why teh custom post types were not working i had to change how the script retrievd an id. Now I have one final thing to fix for some reason when the script runs when a page is edited the xml output by the script is the previous save data. SO it means i have to press save twice to make my new edits appear. Is it getting the revisions or somethingbeing triggered too early perhaps?

I am trying to run a script when a user publishes / updates a post.

I am using the filter: wp_insert_post_data

The problem I am having is the script is a php file outside of WordPress but on the same site (It works fine if i go direct to it) that just needs to be run. I tried to include the file using the filter but that stopped the post being updated for some reason.

This is my current code:

function updateFeed( $data , $postarr) {
   include 'jobsfeed.php';  
   return $data;
}

add_filter( 'wp_insert_post_data' , 'updateFeed' , '99', 2 );

Is there any way to be able to run this script?

EDIT:

It does seem teh file is being run but for some odd reason it is not outputting the custom field values. It is a simple php file with a loop using wp_query and it works fine when I go direct to it. - any ideas what it could be?

EDIT:

Figured out why teh custom post types were not working i had to change how the script retrievd an id. Now I have one final thing to fix for some reason when the script runs when a page is edited the xml output by the script is the previous save data. SO it means i have to press save twice to make my new edits appear. Is it getting the revisions or something?

I am trying to run a script when a user publishes / updates a post.

I am using the filter: wp_insert_post_data

The problem I am having is the script is a php file outside of WordPress but on the same site (It works fine if i go direct to it) that just needs to be run. I tried to include the file using the filter but that stopped the post being updated for some reason.

This is my current code:

function updateFeed( $data , $postarr) {
   include 'jobsfeed.php';  
   return $data;
}

add_filter( 'wp_insert_post_data' , 'updateFeed' , '99', 2 );

Is there any way to be able to run this script?

EDIT:

It does seem teh file is being run but for some odd reason it is not outputting the custom field values. It is a simple php file with a loop using wp_query and it works fine when I go direct to it. - any ideas what it could be?

EDIT:

Figured out why teh custom post types were not working i had to change how the script retrievd an id. Now I have one final thing to fix for some reason when the script runs when a page is edited the xml output by the script is the previous save data. SO it means i have to press save twice to make my new edits appear. Is it getting the revisions or being triggered too early perhaps?

added 375 characters in body
Source Link
Lee
  • 155
  • 2
  • 15

I am trying to run a script when a user publishes / updates a post.

I am using the filter: wp_insert_post_data

The problem I am having is the script is a php file outside of WordPress but on the same site (It works fine if i go direct to it) that just needs to be run. I tried to include the file using the filter but that stopped the post being updated for some reason.

This is my current code:

function updateFeed( $data , $postarr) {
   include 'jobsfeed.php';  
   return $data;
}

add_filter( 'wp_insert_post_data' , 'updateFeed' , '99', 2 );

Is there any way to be able to run this script?

EDIT:

It does seem teh file is being run but for some odd reason it is not outputting the custom field values. It is a simple php file with a loop using wp_query and it works fine when I go direct to it. - any ideas what it coulecould be?

EDIT:

Figured out why teh custom post types were not working i had to change how the script retrievd an id. Now I have one final thing to fix for some reason when the script runs when a page is edited the xml output by the script is the previous save data. SO it means i have to press save twice to make my new edits appear. Is it getting the revisions or something?

I am trying to run a script when a user publishes / updates a post.

I am using the filter: wp_insert_post_data

The problem I am having is the script is a php file outside of WordPress but on the same site (It works fine if i go direct to it) that just needs to be run. I tried to include the file using the filter but that stopped the post being updated for some reason.

This is my current code:

function updateFeed( $data , $postarr) {
   include 'jobsfeed.php';  
   return $data;
}

add_filter( 'wp_insert_post_data' , 'updateFeed' , '99', 2 );

Is there any way to be able to run this script?

EDIT:

It does seem teh file is being run but for some odd reason it is not outputting the custom field values. It is a simple php file with a loop using wp_query and it works fine when I go direct to it. - any ideas what it coule be?

I am trying to run a script when a user publishes / updates a post.

I am using the filter: wp_insert_post_data

The problem I am having is the script is a php file outside of WordPress but on the same site (It works fine if i go direct to it) that just needs to be run. I tried to include the file using the filter but that stopped the post being updated for some reason.

This is my current code:

function updateFeed( $data , $postarr) {
   include 'jobsfeed.php';  
   return $data;
}

add_filter( 'wp_insert_post_data' , 'updateFeed' , '99', 2 );

Is there any way to be able to run this script?

EDIT:

It does seem teh file is being run but for some odd reason it is not outputting the custom field values. It is a simple php file with a loop using wp_query and it works fine when I go direct to it. - any ideas what it could be?

EDIT:

Figured out why teh custom post types were not working i had to change how the script retrievd an id. Now I have one final thing to fix for some reason when the script runs when a page is edited the xml output by the script is the previous save data. SO it means i have to press save twice to make my new edits appear. Is it getting the revisions or something?

added 241 characters in body
Source Link
Lee
  • 155
  • 2
  • 15

I am trying to run a script when a user publishes / updates a post.

I am using the filter: wp_insert_post_data

The problem I am having is the script is a php file outside of WordPress but on the same site (It works fine if i go direct to it) that just needs to be run. I tried to include the file using the filter but that stopped the post being updated for some reason.

This is my current code:

function updateFeed( $data , $postarr) {
   include 'jobsfeed.php';  
   return $data;
}

add_filter( 'wp_insert_post_data' , 'updateFeed' , '99', 2 );

Is there any way to be able to run this script?

EDIT:

It does seem teh file is being run but for some odd reason it is not outputting the custom field values. It is a simple php file with a loop using wp_query and it works fine when I go direct to it. - any ideas what it coule be?

I am trying to run a script when a user publishes / updates a post.

I am using the filter: wp_insert_post_data

The problem I am having is the script is a php file outside of WordPress but on the same site (It works fine if i go direct to it) that just needs to be run. I tried to include the file using the filter but that stopped the post being updated for some reason.

This is my current code:

function updateFeed( $data , $postarr) {
   include 'jobsfeed.php';  
   return $data;
}

add_filter( 'wp_insert_post_data' , 'updateFeed' , '99', 2 );

Is there any way to be able to run this script?

I am trying to run a script when a user publishes / updates a post.

I am using the filter: wp_insert_post_data

The problem I am having is the script is a php file outside of WordPress but on the same site (It works fine if i go direct to it) that just needs to be run. I tried to include the file using the filter but that stopped the post being updated for some reason.

This is my current code:

function updateFeed( $data , $postarr) {
   include 'jobsfeed.php';  
   return $data;
}

add_filter( 'wp_insert_post_data' , 'updateFeed' , '99', 2 );

Is there any way to be able to run this script?

EDIT:

It does seem teh file is being run but for some odd reason it is not outputting the custom field values. It is a simple php file with a loop using wp_query and it works fine when I go direct to it. - any ideas what it coule be?

code spacing
Source Link
EAMann
  • 32.2k
  • 9
  • 88
  • 147
Loading
added 21 characters in body
Source Link
Lee
  • 155
  • 2
  • 15
Loading
Source Link
Lee
  • 155
  • 2
  • 15
Loading