• About
    • Blog
    • Business Process
    • Charity Work
    • History
    • News
  • Services
    • Legacy System Support
    • Bespoke System Development
    • Web Design & Development
    • View all services
  • Products
  • Our work
    • Customers
    • Case Studies
  • Careers
  • Contact
Microsoft Partner - Application Development
29th May 2015

Expression Engine Update Function

PHP PSP Knowledge
Expression Engine Update Function
This php code gets an item with the same URL title, if one exists then it updates it in expression engine.
<?php
ee()->load->library('api');
ee()->api->instantiate('channel_entries');
ee()->api->instantiate('channel_fields');
ee()->api->instantiate('channel_categories');

$title = 'your title';
$friendlyUrl = 'your friendly url';

$query = ee()->db->get_where('channel_titles', array('url_title' => $friendlyUrl), 1);
if($query->num_rows() > 0)

$row = $query->row(); $entry_id = $row->entry_id; if ($entry_id != FALSE)

$data = array( // set your values, see below for an example 'title' => $title ); ee()->api_channel_fields->setup_entry_settings(1, $data); if (ee()->api_channel_entries->save_entry($data, 1, $entry_id) === FALSE)

echo 'Error';

else

echo "Success";

?>
Share:
PSP IT Design & Development
About Us
  • Privacy Policy
  • History
  • Customers
  • News
  • Blogs
Services
  • Legacy System Modernisation
  • Website Design & Development
  • Bespoke Application Development
  • Outsource IT Strategy
  • All Services
Contact
  • 01775 722377
  • letstalk@psp-it.co.uk
  • Carver House, Apex Court, Spalding Office Park, Elsoms Way, Pinchbeck, Spalding,Lincolnshire, PE11 3UL

Terms & Conditions Privacy Policy

© PSP People Systems Process Ltd. 2022. All Rights Reserved.

MENU

MENU

  • About

    • Blog

    • Business Process

    • Charity Work

    • History

    • News

  • Services

    • Legacy System Support

    • Bespoke System Development

    • Web Design & Development

    • View all services

  • Products

  • Our work

    • Customers

    • Case Studies

  • Careers

  • Contact

© PSP People Systems Process Ltd. 2022. All Rights Reserved. Privacy Policy

give us a call
01775 722377
drop us an email