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

  • Home
  • SEARCH
  • 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 7635513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:26:45+00:00 2026-05-31T07:26:45+00:00

I have made a wordpress plugin that can fetch an unknown number of Google

  • 0

I have made a wordpress plugin that can fetch an unknown number of Google calendar feeds and show the next event for every calendar in a widget. It works, but right now I have hardcoded the feeds into the code. It does’nt seems like very good practise so I am planning for an admin interface. For every feed I add there is three pieces of information that are stored with them in an array: a) the feed url. b) A nickname for the feed. c) If the nickname should be shown.

Here is some ugly mockup of the admin interface I did just to show the idea:
Screenshot of mockup

My problems with this:

  1. I know by all tutorials how to store one piece of information in one variable. But how do I store an unknown number of them? Could I use an array with the $instance variable? I have really no clue from the code samples I’ve seen of how to do that.

  2. How do I make this dynamic, so for every feed I add it instantly shows up in the interface? There would be great to be able to change the order of them also.

I want to learn and regarding question number two I think I could come upp with something in javascript when I’m there. But for question number one I have no idea where to start looking. So if someone could give some hints and a push in the right direction I would be very thankful.

Update

Thanks for the input. I really need to free some time to try to implement this, but i may take a few days more. The answer that was the most helpfull to me get the bounty…

  • 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-05-31T07:26:46+00:00Added an answer on May 31, 2026 at 7:26 am

    You can save array’s with add_option(), update_option() And read get_option()
    I would recommend against this if you plan to store more then ~20.

    <?php
    $feeds = array(
        0 => array(
            'feedUrl' => 'http://calander.google.com/calname1',
            'nickname' => 'first calander',
            'useNick' => false
        ),
        1 => array(
            'feedUrl' => 'http://calander.google.com/calname2',
            'nickname' => 'birtday calander',
            'useNick' => true
        ),
        2 => array(
            'feedUrl' => 'http://calander.google.com/calname3',
            'nickname' => 'take out garbage days calander',
            'useNick' => false
        ),
    );
    add_option('calender_feeds', $feeds, '', 'no');
    ?>
    
    
    <?php
    //read feeds
    $feeds = get_option('calender_feeds');
    ?>
    

    As suggested for the dynamic adding of multiple field I suggest jQuery.

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

Sidebar

Related Questions

I have a custom WordPress plugin I made and it doesn't seem to work
I have made a website that has 2 WordPress installs one for English language
I made a quiz app using wordpress using a quiz plugin so that, the
I have made a custom UserControl i Vb.net (windows application). How can I add
I have made a little app for signing up for an event. User input
I have made a class which a form can inherit from and it handles
I have made an application (for my self) for feeds reading, using SyndicationFeed ,
I have made a multiplayer game using the GameKit Framework where 2 iPhones/iPods can
I'm writing a plugin for Wordpress developers that allows a dev to include my
thanks for reading! Here's what I'm up to. I'm writing a WordPress plugin that

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.