Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8457509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:49:35+00:00 2026-06-10T12:49:35+00:00

Works flawlessly now. Updated code. Thank you newfurniturey. function foo_options(){ global $post; if (isset($custom[‘website_url’])

  • 0

Works flawlessly now. Updated code. Thank you newfurniturey.

  function foo_options(){
           global $post;
   if (isset($custom['website_url']) && isset($custom['website_url'][0])) {
   $website_url = isset($custom['website_url']) ? $custom['website_url'][0] : '';}
   ?>

<div id="foo-options">
<label>Website URL:</label><input name="website_url" value="<?php echo $website_url; ?>" />     
</div><!--end foo-options--> 
<?php

   }
{

   function update_website_url(){
       global $post;   
       if (($post != null) && isset($_POST['website_url'])) {
       update_post_meta($post->ID, "website_url", $_POST["website_url"]);
     }
  }

Updated code and bin. http://pastebin.com/2ZWisprm

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T12:49:36+00:00Added an answer on June 10, 2026 at 12:49 pm

    To address the issues in-order, regarding the following line:

    update_post_meta($post->ID, "website_url", $_POST["website_url"]);
    

    trying to access a property of a non-object applies to $post->ID. The only way this error can occur is if $post is not an object (such as an array), or if it’s null.

    The undefined index error applies to $_POST["website_url"]; This will happen when either your form is not currently being POSTed, or the field-name does not exist in the current POST data.

    I do not know what object is supposed to be within your $post variable, so the following is just a guess, but try the following update:

    function update_website_url(){
        global $post;   
        if (($post != null) && isset($_POST['website_url'])) {
            update_post_meta($post->ID, "website_url", $_POST["website_url"]);
        }
    }
    

    This will make sure $post is not null, and by assumption that it is a proper object, and that the website_url index has been set. You may want to increase the check to use !empty() instead of isset(), but the above should resolve your error (unless $post is an array, or other non-object data type).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've written some MPI code which works flawlessly on large clusters. Each node in
I've hacked together something that works flawlessly but it's really ugly code and I
I have almost created a website that works in all major browsers flawlessly. Yesterday,
This works. $(document).ready(function(){ $(.items article).click(function(){ window.location=$(this).find(a).attr(href); return false; }); }); However , when the
This works when I have only one state code as a parameter. How can
For years now I've been using a chat that has the following code to
On iPhone I simply do this (and it works flawlessly): view.transform = CGAffineTransformRotate(transform, [(UIRotationGestureRecognizer
I'm currently receiving a serialized object through a socket connection, this works flawlessly. I'm
I have integrated Facebook in my app. It works flawlessly in dev environment -
Works fine on Debug|iphone build. For Release|iphone I am getting following error: ld: duplicate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.